Fixed header column widths
Fixed header column widths
g1p
Posts: 5Questions: 0Answers: 0
Hi Allan,
I'm having inordinate amounts of difficulty getting Fixed Headers to set proper widths. I have spent a day poring over the forums and trying different things. No amount of trying will make the header respect the table column widths. I am calling fnAdjustColumnSizing(). I've tried setting styles manually and in code. Nothing will override the widths set on the elements. I've tried everything I can think of and several things I found here. No luck. I've created a log-in for you in our application (give it 15mins) so you can see the problem. I'll provide the details via PM. If you go into Analytics and look at the table on the main All Traffic page, you'll see the problem. I'm dynamically adding summary rows to the header and footer of this one, which makes things much more difficult I might add, but the problem remains without them. If you then look at Products& Orders, you'll see that those tables have fixed headers but no summary rows...and the same problem. You will also see that the fixed header widths are wrong if you scroll over to the far right. Finally, on the All Traffic table, if you remove styling on the top summary rows you will see that the row for 11/7 is underneath the header, so it's not even respecting the width and height. I'm at a loss to know what to do. Any advice will be appreciated. I'm using the latest nightly of Fixed Headers and Datatables 1.9.4.
I was also disappointed to find that Fixed Headers isn't compatible with scrolling. That's a major limitation. Is it likely to be fixed in the next release?
Many Thanks,
Gary.
I'm having inordinate amounts of difficulty getting Fixed Headers to set proper widths. I have spent a day poring over the forums and trying different things. No amount of trying will make the header respect the table column widths. I am calling fnAdjustColumnSizing(). I've tried setting styles manually and in code. Nothing will override the widths set on the elements. I've tried everything I can think of and several things I found here. No luck. I've created a log-in for you in our application (give it 15mins) so you can see the problem. I'll provide the details via PM. If you go into Analytics and look at the table on the main All Traffic page, you'll see the problem. I'm dynamically adding summary rows to the header and footer of this one, which makes things much more difficult I might add, but the problem remains without them. If you then look at Products& Orders, you'll see that those tables have fixed headers but no summary rows...and the same problem. You will also see that the fixed header widths are wrong if you scroll over to the far right. Finally, on the All Traffic table, if you remove styling on the top summary rows you will see that the row for 11/7 is underneath the header, so it's not even respecting the width and height. I'm at a loss to know what to do. Any advice will be appreciated. I'm using the latest nightly of Fixed Headers and Datatables 1.9.4.
I was also disappointed to find that Fixed Headers isn't compatible with scrolling. That's a major limitation. Is it likely to be fixed in the next release?
Many Thanks,
Gary.
This discussion has been closed.
Replies
I don't really see the benefit of using FixedHeader and scrolling at the same time - aren't they basically trying to solve the same thing - the table headers being made more visible? The scrolling case works because the scrolling viewport is typically less than the browser.
It could be fixed in a future release, but its not currently a priority.
Regarding the actual alignment issue - I wonder if it is related to the total rows. Can you remove them from the main table and see if that helps at all? Is there Javascript updating them or something else? You might need to call the fnUpdate API method if you aren't already (I can't actually see where the DT initialisation is - it looks like you have a shim layer on top of it?).
Allan
Thanks for looking. I'm referring to horizontal scrolling, obviously.
Re: the columns. The tables are built via a jQuery plugin which uses a template. I'm inserting those rows into the header and footer as the table is created. No shim but lots of internal code, yes. I hadn't seen fnUpdate but I don't see how that can update headers or footers. I've already tried all the permutations of removing things that I can think of. Even removing any hint of the header rows doesn't result in properly aligned header columns. I retried for posterity. Nothing changed. Removing fixed headers restores things to their rightful state.
I had the tables working nicely, with summary rows, before trying to add the fixed headers, using horizontal scrolling. It's only been problematic since.
I'm still stumped.
Thanks.
I was unable to get fixed column widths working either, when I tried. I had thought that that might work around the sizing issues but it would be far from ideal as our column widths can vary. Either way, we will probably have to live without this now as the amount of development effort doesn't justify the results.
Cheers.