DataTable Header and Body is not aligned

DataTable Header and Body is not aligned

dhruvsha2707dhruvsha2707 Posts: 1Questions: 1Answers: 0

Hey guys,

Basically, I am using two data tables in my view.
First table contains headers, sub headers and aggregated data.
Second one contains actual dataset.

Fiddle link:

Both tables have same numbers of columns and shares same properties (eg. width, height, colspan, rowspans etc) but even then, both have asymmetric column width. Is there any solution for this?

This is how columns looks like:


  • kthorngrenkthorngren Posts: 14,175Questions: 25Answers: 3,345

    I found a few issues, see this example:

    1. You had too many th elements in the second header row of each table. You only need enough to cover the 7 columns using colspan.
    2. Not sure what dom: "F" is. Maybe you have a custom feature that you aren't showing. I have found that t always needs to be included when using the dom option or strange things happen with the table. So I changed it to dom: "t" for the example.

    The columns.width docs explain a little about calculating column widths. The only thing I could find to do is to display the header of the second table. Maybe @allan can provide further help.

    Are you doing this because you want a particular row always displayed at the top? If so maybe the solution in this blog will help.


Sign In or Register to comment.