One of the commenters on my inline editable table routine suggested that it 
would be helpful if the routine could sum the columns. I decided that would 
be a helpful thing. Eric has a routine that does that for TiddlyWiki 
Classic but, unfortunately, it does seem to work with TW5. So I reworked 
and extended it myself. Eric will undoubtedly recognize a good amount of 
his code and documentation. No doubt, he could write my additions more 
elegantly than I have.

In addition to doing the sum, the count and the average of a column, I've 
added the minimum and maximum. I also created a separate routine to 
accomplish the same functions for rows. 

In Eric's routine you used  
<<columncalc count all 1 -1>>

while in mine,
<<ColCalc tableID count 1 -1 all>>
or
<<RowCalc tableID count 1 -1 all>>

where the tableID refers to either an HTML table such as 
<table ID="myTable">...</table>

or an HTML div such as 
<div id="myTable">...</div>

that contains a wikitext table. I couldn't figure out a better way of 
limiting the function to the table which contains it. If someone has a 
better approach, I'd love to hear it. 

Table cells may contain just about anything though some, such as anchors, 
will always be interpreted as text. When the cell contains an input box, 
the row and column calculations don't automatically update. I don't have a 
way I really like to force TW to update a displayed tiddler so I'm open to 
suggestions about that as well.

The routines and some examples are located at 
http://tablecalcs.tiddlyspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/53a3c9f9-f4e6-45ab-bfc8-5e939e9eb355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to