Adding a child row with identical formatting

Adding a child row with identical formatting

CrlotronCrlotron Posts: 16Questions: 5Answers: 0
edited January 2022 in Free community support

I'm trying to add additional data in a child row using identical structure to the parent row (columns, alignment, etc). In other words, I want the child row to appear seamlessly below its parent with columns in alignment. Thanks to @bindrid, whose posted bin I hijacked for my example.

For the example, let's say that it's showing multiple roles for a single person (even though I've set it to be the same information as the parent). In my program the data will be different and have a variable number of rows using a different but related data source. To mimic this, my "format" function uses the same data but matched to the parent's row.

The returned result for the child is a new table, appearing under the parent. Is there a way to instead inject a row into the existing table or fully mimic the parent table's structure? I haven't seen this in any of the examples here (or those I found elsewhere). In the example, you can see how misaligned the columns are, because some fields are not included (in this case, the button and name). My program uses Bootstrap so I don't want to simply force fixed column widths for all columns. Thanks for any help or direction.

Example here: http://live.datatables.net/nugudefa/1/edit

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.