How to simply add a "title" to a table?
How to simply add a "title" to a table?
erwin007
Posts: 3Questions: 1Answers: 0
I need to add a title to the table and can't find anywhere an easy solution.
Answers
There is nothing built into Datatables for this. You can add the appropriate HTML above the
table
tag in you document. If you want the title integrated with the Datatables elements you can use the technique in this example.Kevin
Hi Kevin, this is already a great help but when I actually want to print the table (=save as pdf) that title isn't there.
This is my code:
See this example which shows adding a title to the export.
Kevin
Kevin, you are my hero for today!!
Thank you so much!
The other option, is to use the
caption
tag for tables. It has the advantage of being the semantic tag for exactly the method you describe, so screen readers, etc will handle it correctly (or at least should!).Here is a little example of that.
Allan