Table Header
Table Header
Andreas S.
Posts: 208Questions: 74Answers: 4
Hi,
When I click on a link to see a data table, the complete title line is displayed first. With the columns which are supposed to be invisible.
I think the users are confused when they first see the complete title line.
Is it possible to prevent this?
Andreas
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I use the DataTables columnDefs option to hide columns:
https://datatables.net/reference/option/columnDefs
Kevin
I use this function, but in the fist step, datatable load the data, I see all headers. After all data loaded, the invisible rows are removed.
Andreas
Sounds like there is a delay between the web page being loaded and the DataTable initialization. Do you have other code executing before initializing the table?
If you have the JS in a separate file there may be a delay in loading it.
You may need to provide a link to your page for troubleshooting.
Kevin
I do it this way. In Html set the Table hidden:
<
table class="table table-striped table-bordered table-hover pageResize hidden" id="personTable" cellspacing="0" width="100%" style="background: #EEEEEE">
after initialization remove the hidden class:
$('#personTable').DataTable({
initComplete: function () { $('#personTable').removeClass('hidden'); }
});
regards
Uli
Perfect, Thanks this works.
Regards
Andreas