always needed?

always needed?

TobiasBgTobiasBg Posts: 8Questions: 1Answers: 0
edited December 2009 in General
Hi,

just a quick question, for which I just need a short confirmation:
On http://datatables.net/usage/ it is said, that a table needs the "thead" and "tbody" sections to be declared.

Is this also required if I only want pagination and filtering (but not sorting) for a table? And how about the TableTools?

Thanks!
Tobias

Replies

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Hi Tobias,

    Yes - thead and tbody are required at all times by DataTables, regardless of sorting enablement etc. TableTools is a plug-in for DataTables only (it's not a standalone application) and therefore also required thead and tbody to be defined.

    Hopefully it's not to much trouble to add these tags in (it's good semantic HTML apart from anything else :-) ). If you are using a CMS that doesn't output thead and tbody, and you can't modify it's templates, then what you can do is use Javascript to create the two required tags and then shunt the TR tags into each section as required (the first one into thead, and the remainder into tbody for example).

    Regards,
    Allan
This discussion has been closed.