Remove / Hide child's inner datatable thead

Remove / Hide child's inner datatable thead

Red SniperRed Sniper Posts: 52Questions: 11Answers: 0

Hell there,

I have tried following this guide to set a datatable with editor as the content of a child row.
I don't want, though, the header of this table to be displayed, as it matches the one of the parent table.
This is causing a little issue because If I hide that header, editor won't work (I cannot edit the cells on focus anymore).

Is there a solution for this ?

Thanks in advance

Answers

  • Red SniperRed Sniper Posts: 52Questions: 11Answers: 0
  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Hi,

    Have you tried hiding the header of the child table using CSS? E.g.:

    tr.dt-hasChild thead {
      display: none;
    }
    

    Allan

  • Red SniperRed Sniper Posts: 52Questions: 11Answers: 0
    edited March 20

    Hi Allan,

    I already tried using css, and I managed to hide the thead.
    Unfortunately, this causes other issues with alignment to the parent table (adjust() doesn't work in this case), probably because it is a table with ScrollY enabled (?).

    If there is no another way, I will just keep it as it is.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Ah - I wasn't clear that you wanted the cells to align. For that you need to add the child rows as a tr. See row().child() - you can pass a tr to be added as the child row.

    That isn't covered in the blog post originally linked to, but it might do what you need.

    Allan

Sign In or Register to comment.