When you scroll down a page with a sticky-header table, generated by drupal theme_table() function, you can see that sticky header appears when the first pixel row, containing table is out of visible area. If the table has caption, sticky header appears when the top of the caption is out of visible area, so the bottom part of table (non-sticky) header and sticky header are visible at the same time.
As i guess, my english is far from perfect, so screenshots seem to be better explanantion.
After sticky header has appeared.
You can see repeated word "updated" and repeated arrow at the second screenshot. The first is the sticky header, the second is the usual table header.
This can be fixed, calculating the vertical position of sticky header from the top of e.table.tHead element instead of e.table element. Also we need to change e.vLength calculation to prevent its dependency on the caption height.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1882072_sticky_header_with_caption_fix.patch | 884 bytes | paravibe |
| tableheader.js_.patch | 1.45 KB | An43 |
Comments
Comment #0.0
An43 commentedFormatting changes. Added
tags for code elements.Comment #0.1
An43 commentedTypo fix: "calulation" -> "calculation".
Comment #1
droplet commented@paravibe's patch from #2505099: Sticky headers wrong behaviour in case a table has caption.
https://www.drupal.org/files/issues/sticky_header_with_caption_fix.patch
(I verified there's no errors in D8)
Comment #2
paravibe commentedOk then,
here is patch for 6.x
Comment #4
paravibe commentedComment #6
paravibe commentedComment #7
paravibe commentedAny update here?