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.

Before sticky header appears

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.

Comments

An43’s picture

Issue summary: View changes

Formatting changes. Added tags for code elements.

An43’s picture

Issue summary: View changes

Typo fix: "calulation" -> "calculation".

droplet’s picture

Version: 6.27 » 7.x-dev
Issue summary: View changes
Issue tags: +Needs backport to D6
paravibe’s picture

Assigned: An43 » paravibe
StatusFileSize
new884 bytes

Ok then,
here is patch for 6.x

Status: Needs review » Needs work

The last submitted patch, 2: 1882072_sticky_header_with_caption_fix.patch, failed testing.

paravibe’s picture

Version: 7.x-dev » 6.x-dev

Status: Needs work » Needs review
paravibe’s picture

Version: 6.x-dev » 7.x-dev
Issue tags: -Needs backport to D6
paravibe’s picture

Any update here?

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.