tfoot renders after thead and before tbody
tfoot renders after thead and before tbody
Allan, I noticed this at http://www.datatables.net/usage/:
"Defining the 'tfoot' section is optional from the view point of DataTables, and if defined will be used in a similar manner to how thead is used, with the exception of not being able to use it to sort data."
In my original markup the tfoot node comes after tbody, but when dataTables renders it, it's moving tfoot between thead and tbody. Is there a setting somewhere where i can keep it at the end?
thanks again for a great plugin, it's really amazing.
"Defining the 'tfoot' section is optional from the view point of DataTables, and if defined will be used in a similar manner to how thead is used, with the exception of not being able to use it to sort data."
In my original markup the tfoot node comes after tbody, but when dataTables renders it, it's moving tfoot between thead and tbody. Is there a setting somewhere where i can keep it at the end?
thanks again for a great plugin, it's really amazing.
This discussion has been closed.
Replies
$('table.dataTable tfoot').each(function () {
$(this).insertAfter($(this).siblings('tbody'));
});
Since we're not using sortable headers in the mobile view, the other approach i could use is to disable dataTables using something like enquire.js for mobile widths.
Allan
The problem i'm having is getting it to work with some responsive CSS (no-more-tables.css), where we render the table headers to the left of the the TD contents for each row. For these, the tfoot is appearing at the top (as that's how the code flows) but we need it at the bottom.
I can just use the jquery workaround to manually rearrange them in order to get it to work as needed.
If you are able to show us a code example of what you are working with, we might be able to help resolve the issue.
Regards,
Allan
http://elvery.net/demo/responsive-tables/
Bookmarked to play with :-)
Allan
[code]
thead tr,
tfoot tr {
position: absolute;
top: -9999px;
left: -9999px;
}
[/code]
It doesn't look like there is anything which is DOM position specific.
Allan
But in this case, the footer text is like a footnote for the whole table, it doesn't map to td cells. So we still want it to appear across the bottom.
Allan