Number of td-tags in tfoot has to match tbody. Disregarding [colspan]
Number of td-tags in tfoot has to match tbody. Disregarding [colspan]
Bug or possible feature request:
I always end my tables with a tfoot-tag with a td-tag that has colspan="99" or something high enough to never be a problem.
It's usually a style/design decision to do this as i want all my tables to look the same, disregarding if they actually have content in tfoot or not.
I get an error here:
// Cache the footer cells. Note that we only take the cells from the first
// row in the footer. If there is more than one row the user wants to
// interact with, they need to use the table().foot() method. Note also this
// allows cells to be used for multiple columns using colspan
if ( tfoot !== null ) {
var cells = oSettings.aoFooter[0];
for ( i=0, ien=cells.length ; i<ien ; i++ ) {
column = columns[i];
column.nTf = cells[i].cell;
if ( column.sClass ) {
$(column.nTf).addClass( column.sClass );
}
}
}
The problem seems to be column = columns[i];
and then column.nTf = cells[i].cell;
since column
is null because there is more cells
than columns
.
I suggest you replace: ien = cells.length
with ien = columns.length
in the for
-loop declaration
Love DataTables! Best tool i've come across in a long time! Well done!
Replies
That's not valid HTML though.
Try running the following HTML through the W3C validator:
I can see why you've done that, but DataTables assumes valid HTML. Anything else would just be a nightmare to support (perhaps an easy fix for this one, but not for many others).
Thank you! Really delighted to hear that you are enjoying using it (minus the colspan!).
Allan