multiple columns in thead and tfoot but a free form (one cell) tbody

multiple columns in thead and tfoot but a free form (one cell) tbody

MithrusMithrus Posts: 19Questions: 0Answers: 0
edited February 2010 in General
I have a need to display a record using a free form template (meaning not columnar). The data source is server side, so I have control in formatting the data field, but I wasn't sure how to set up the dataTable call.

I need something like this:
[thead 1][thead 2][thead 3]
[
Other text [column 1]
[column 2] and more text
[column 3] and still more.
]
[tfoot 1][tfoot 2][tfoot 3]

where each "column" i denoted in []'s. I cant just style the td's, because the actual data row is really a html fragment I need to put into a single cell. Suggestions?

Oh, also, is there a way to have the search fields appear at the top of the table, essentially putting tfoot above thead?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm not quite sure what you mean here. Could you post an HTML example? Thanks!

    WRT the search field - I presume your are referring to the demo of the individual column filtering. In which case, if you have a look at the code, you'll see that it's just a bunch of tags in the tfoot element. You can move them to where ever you want.

    Allan
  • MithrusMithrus Posts: 19Questions: 0Answers: 0
    I got the individual column filtering demo to work for my implementation. I have another similar need, but rather than displaying each row in a tabular format, I need it displayed using a template. So, in essence, the end result would be something like this:


    labelfield1labelfield2labelfield3labelfield4
    filterfield1filterfield2filterfield3filterfield4
    field1
    field2
    field3
    field4
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Oh I see... Sorry to say that DataTables doesn't support colspan (or rowspan) in the tbody... The reason being that it would make implementing any sorting and filtering rather difficult. I did have a hack for colspan kicking around a while ago - so it's sort of possible, but I've never thought of an elegant solution that I like. it would also mess up the column visibility options...

    Allan
This discussion has been closed.