I've got a fairly large table that needs to have a total on the right side and bottom for daily totals.
I've been able to get the side to total correctly, but not the bottom.
I may be thinking too little of this, but currently I have this: (Yes, I know it's not correct and doesn't work. I was testing)
script:
HorizVertiCalc = function(h, v){
$('.R'+r).sum("keyup", ".vttl"+v);
$('.C'+v).sum("keyup", ".vtotal"+r+v);
}
markup:
<cfloop from="1" to="#ArrayLen(labels)#" index="r">
<tr>
<td class="labels"><cfif ArrayIsDefined(labels,r) AND labels[r] NEQ "Open">#labels[r]#</cfif></td>
<cfloop from="1" to="7" index="i">
<td id="Day#i#" class="row#r# col#i#">
<cfif r EQ 1>#Left(DayOfWeekAsString(i),3)#<cfelse><cfif r EQ 2><input type="text" class="date-mask" /><cfelse><input type="text" class="calc R#r# C#i# vtotal#r##i#" onkeypress="return HorizVertiCalc(#r#, #i#)" /></cfif></cfif></td>
</cfloop>
<td class="totals"><cfif r EQ 1>Total<cfelse><input type="text" class="ttl#r# vttl#i#" readonly="readonly" /></cfif></td>
</tr>
</cfloop>
As you can see, I'm producing the table with loops, and so I need to get the total for each column and each row.