Table with multiple rows for each row

Table with multiple rows for each row

thedladethedlade Posts: 3Questions: 1Answers: 0

Hello, is it possible to get a table with multiple rows like this: http://i.imgur.com/HMbYzpo.png

cheers

This question has an accepted answers - jump to answer

Answers

  • AshbjornAshbjorn Posts: 55Questions: 2Answers: 16
    Answer ✓

    Hi thedlade,

    AFAIK DataTables does not support this kind of behavior in the tbody though it does have some options for Complex Headers.

    I am not sure if @Allan even changed his mind on this kind of support, but it might not be likely, as indicated in this post here

    There has been efforts for a plugin that facilitates a somewhat similar manner of achieving the appearance of a span here: Plugin: FakeRowSpan.

    Lastly you could probably achieve this by applying a formatter for your data and use clever CSS tricks to recreate that layout that you linked.

    Hope this helps,

  • thedladethedlade Posts: 3Questions: 1Answers: 0
    edited August 2015

    Thanks Ashbjorn, I'll check out fakerowspan

  • allanallan Posts: 63,725Questions: 1Answers: 10,505 Site admin

    Yes, I've not changed my position of this. You could apply some kind of post processing to the table after each draw to get a table like what you want, but fundamentally, in DataTables each row is independent of the others.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    I use the datatables plugin that lets you expand a row, add a child row, works great

  • thedladethedlade Posts: 3Questions: 1Answers: 0

    allan, I might try that but if it takes too much time, I'll try another method

    jhyland87, how do you keep that row expanded by default?

  • allanallan Posts: 63,725Questions: 1Answers: 10,505 Site admin

    If the row is "open" (row().child()), it will automatically stay open.

    Allan

This discussion has been closed.