Reputation: 817
I am creating an HTML table with jQuery's DataTables plug-in. I would like to know if there is a way to group a number of columns together with a Title which describes what the grouping represents.
In my specific case, 3 of my columns will display an address (Street, City, State). I'd like them to have an additional border around just those columns with a title that indicates to the end-user that those 3 columns represent the address.
I'm considering just changing the background color of those 3 columns which will do the job but I'm wanting the Address title to be displayed. I've seen that rows can be grouped together and sections divided by separators; however, I haven't yet come across anything that makes it possible to group columns together.
Upvotes: 0
Views: 8740
Reputation: 17550
To show group headers see this example (build the <thead>
element using colspan
and rowspan
).
To show borders around you group build CSS
classes with border-left
and border-right
and use the columns.className option for the first and last column in your group.
Upvotes: 1