Cgridview Alignment

Is there and easy way to get the header and filter elements to line up with the data columns in cGridview? I’m using a lot of grids, and it always seems that the header and filter for columns doesn’t line up without doing a lot of fiddling with the column widths.

Usually, the column on the far left is ok, and the column on the far right is ok, but the columns in the middle creep out of alignment near the center. The more columns the grid has, the worse it is.

I’ve attached a snip so you can see what it is doing. The data in all the data cells is left aligned. You can easily see the problem in the column that is third from the left - the date column. I’ve tried setting “width” the same for headerHtmlOptions ahd htmlOptions with no luck. I’ve tried setting different widths with headerHtmlOptions and it make no difference.

Any Ideas?

haven’t seen this issue in any of my applications, you should try firebug extension on firefox to monitor if any of the css fails to load or js fails to load on page.

It lines up fine as long as I don’t try to set the width of any columns with htmlOptions. As soon as I do that, the alignment goes crazy. I’ve tried applying the same width to the header using headerHtmlOptions. Checking the page source in firefox shows that the headerHtmlOptions puts the width tag in <th> tag, but it doesn’t seem to do anything. It does seem to be associated with the <thead> tag - if I comment out the <thead> tags, everything lines up, bur I loose the header when I change pages.

I had to add the "table-layout:fixed" tag to the CSS for the table. Works like a charm.