Html Table inside data table pdf button errors.
Html Table inside data table pdf button errors.
Hi all,
So I have a program pulling data into a .Datatable and then in one column of the .Datatable I am creating another table to populate multiple columns under that one header. The second table isn't a .Datatable I imagine it could be I'm just not sure how to implement that. Everything is working with the table view, but when I use the pdf button provided https://datatables.net/extensions/buttons/examples/initialisation/export.html
it doesn't render any styling or format of the table inside of the .Datatable.
Any help on this would be greatly appreciated!
Thanks in advance.
This discussion has been closed.
Answers
Here I am trying to make the second table a .Datatable so the pdf button might be able to work correctly.
$j(document).ready(function() { var table = $j("#projectInfo").DataTable( { "order": [[ 0, "asc" ]], "paging": false, "autoWidth": true, "dom": 'Bfrtip', "buttons": ['pdf','print'], "columns": [ /* Name */ {}, /* Site */ {}, /* Lead */ {}, /* Roles */ {}, ], }); var secondtable = $j("#inside").DataTable( { "paging": false, "autoWidth": true, "dom": 'Bfrtip', "buttons": ['pdf','print'], "columns": [ /* Project Role 1 */ {}, /* Project Role 2 */ {}, /* Project Role 3 */ {}, /* Project Role 4 */ {}, /* Project Role 5 */ {}, /* Project Role 6 */ {}, /* Project Role 7 */ {}, /* Project Role 8 */ {}, /* Project Role 9 */ {}, /* Project Role 10 */ {}, /* Project Role 11 */ {}, ], }); });Can someone please help me out?