I want put 2 rows on 1 row

I want put 2 rows on 1 row

elizondo82elizondo82 Posts: 1Questions: 0Answers: 0
edited September 2011 in General
I want put this:

_________________________________________________________________________________________
[ Column1 ] [ Column2 ] [ Column3 ] [ Column4 ] [ Column5 ] [ Column6 ]
[ Desc Column ] [ Info ]
------------------------------------------------------------------------------
[ Column1 ] [ Column2 ] [ Column3 ] [ Column4 ] [ Column5 ] [ Column6 ]
[ Desc Column ] [ Info ]
------------------------------------------------------------------------------
[ Column1 ] [ Column2 ] [ Column3 ] [ Column4 ] [ Column5 ] [ Column6 ]
[ Desc Column ] [ Info ]
------------------------------------------------------------------------------
[ Column1 ] [ Column2 ] [ Column3 ] [ Column4 ] [ Column5 ] [ Column6 ]
[ Desc Column ] [ Info ]
------------------------------------------------------------------------------

Is possible ?

Replies

  • allanallan Posts: 63,530Questions: 1Answers: 10,473 Site admin
    Not directly, since DataTables doesn't support colspan / rowspan in the tbody of the table. However, it is possible to do a little trick which will end up in the display you want. What you can do is use the fnDrawCallback to insert the second row on each draw, for each row in the display.

    I've used this basic idea for my row grouping example: http://datatables.net/release-datatables/examples/advanced_init/row_grouping.html , which will hopefully give you a bit of a head start with this :-). I'd suggest initialising the table with the desc and info columns as "regular" columns, then using bVisible to hide them and then the fnDrawCallback trick to get the display you want :-)

    Regards,
    Allan
This discussion has been closed.