Fixed Header plugin broken when table has a margin

Fixed Header plugin broken when table has a margin

sviviansvivian Posts: 13Questions: 0Answers: 0
edited December 2010 in FixedHeader
Pretty simple situation here - I'm using the FixedHeader plugin on a long table, but the fixed header row doesn't appear over the real header row: http://i.imgur.com/M3wLT.jpg

After delving into it, the problem is the top margin on the table. The fixed header is moved down exactly the number of pixels of the margin. If I remove the table's margin, the header goes to the right place. I tested on the sample page and the same thing happens.

EDIT: also running into a problem if the table columns change. On one page I hide the images (for faster loading) but have a button to show them (added via Javascript). But the fixed header doesn't refresh itself - the table moves up a line (because the button is removed) and the first column widens but the fixed header doesn't change with it.

Scrolling the page fixes the position and a column sort fixes the width - so perhaps there is some way to force the fixed header to redraw itself?

Replies

  • sviviansvivian Posts: 13Questions: 0Answers: 0
    I've found an ugly workaround for the updating problem. Using [code]var oHeader = new FixedHeader( oTable );[/code] and then [code]oHeader.fnUpdate();[/code] updates the cloned header, but it still stays static while the table is changing and then jumps, which is a little ugly.

    Any other ideas?
  • schnettkerschnettker Posts: 3Questions: 0Answers: 0
    edited January 2011
    We have the same problem here but your "ugly" workaround fixed it.

    Thanks for sharing it!
  • schnettkerschnettker Posts: 3Questions: 0Answers: 0
    hmm.... the fixup doesn't solve the problem on all computers. It seems that the problem only occured on big tables (40col, up to 100rows). The error disapear if I resize the browser window (fullscreen on/off or simple resizing - google chrome).
This discussion has been closed.