Use multiple tbody inside a single table tag
Use multiple tbody inside a single table tag
sarthaks21
Posts: 41Questions: 8Answers: 0
in General
Hey all, I have a page in which there are 3 tables (having same number of columns) which have to be vertically aligned. I am facing a lot of issues in aligning them. I was wondering in I could use the same table with different tbody tags so that alignment is maintained throughout. I was using table-layout: fixed, it worked for a couple of months but I think due to a chrome update it's not working anymore.
Can we initialize a datatable in a tbody tag?
Answers
It might be related to this thread, so it would be worth checking on that.
But yep, you can put a table inside any DOM element and initialise DataTables against it,
Colin
Yeah even I am facing issue since chrome 91 has been released. The webpage was working fine (tables were perfectly aligned) till the moment chrome got updated. I have another computer on which chrome 90 is installed and the tables are perfectly aligned. Any idea how to fix it?
It would be worth keeping an eye on that other thread as Allan is actively working on the problem and will report back there.
Colin
Thanks, will keep tabs on the thread.
Can you please show the syntax to initialize datatable inside a tbody tag?
I'm trying to do something similar to this :
This is a sample, the data will be supplied by ajax such as
Currently I initialize my table like this,
I want to initialize this in a tbody tag
I don't understand you question but hopefully this will help. The Datatables HTML requirements doc states that Datatables needs a properly formatted
table
with athead
and a singletbody
. Datatables won't work properly with the table you show as it contains multipletbody
elements.You can create a table inside a
td
and initialize it as a Datatable.Kevin