This template uses TemplateStyles: |
This sandbox is using {{sticky header}}. I added some more table widths. Divs have been removed.
See: User:Timeshifter/Sandbox243. And: Sandbox245 and Sandbox247 (narrow 3-column tables only). And: Template:Sticky header. And: Template:Sticky header/testcases.
- Substituted {{sticky header}} for {{sticky header/sandbox}}
- Substituted sticky-header for sticky-header-multi
Test sticky-header (no caption)
editWikitable:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 | Header 10 | Header 11 | Header 12 | Header 13 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | data | data | data | data | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | data | data | data | data | a |
Wikitable wikitext:
{{Sticky header}}
{| class="wikitable sticky-header"
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! Header 9 || Header 10 || Header 11 || Header 12 || Header 13
⫶
|}
Plain table:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 |
---|---|---|---|---|---|---|---|---|
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
Plain table wikitext:
{{sticky header}}
{| class="sticky-header"
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! Header 9
⫶
|}
Test sticky-header (no caption). Narrower tables
editHeader | Header 2 | Header 3 |
---|---|---|
3 | data | b |
1 | data | c |
2 | data | a |
Plain table:
Header | Header 2 | Header 3 |
---|---|---|
3 | data | b |
1 | data | c |
2 | data | a |
Test sticky-header (caption)
editSticky first row.
Wikitable:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 |
---|---|---|---|---|---|---|---|---|
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
Wikitable wikitext:
{{sticky header}}
{| class="wikitable sticky-header"
|+ Caption
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! Header 9
⫶
|}
Plain table:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 |
---|---|---|---|---|---|---|---|---|
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
Plain table wikitext:
{{sticky header}}
{| class="sticky-header"
|+ Caption
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! Header 9
⫶
|}
Test sticky-header (sortable)
editSticky first row.
Wikitable:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 | Header 10 | Header 11 | Header 12 | Header 13 | Header 14 | Header 15 | Header 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
top | top | top | top | top | top | top | top | top | top | top | top | top | top | top | top |
3 | data | data | data | data | data | data | data | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | data | data | data | data | data | data | data | a |
bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom |
Wikitable wikitext:
{{Sticky header}}
{| class="wikitable sortable sticky-header"
|+ Caption
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! Header 9 !! Header 10 !! Header 11 !! Header 12
! Header 13 !! Header 14 !! Header 15
! class="unsortable" | Header 16
|- class="sorttop"
| top || top || top || top || top || top
| top || top || top || top || top || top
| top || top || top || top
...
|- class="sortbottom"
| bottom || bottom || bottom || bottom || bottom || bottom
| bottom || bottom || bottom || bottom || bottom || bottom
| bottom || bottom || bottom || bottom
|}
Plain table:
Header | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 |
---|---|---|---|---|---|---|---|---|
top | top | top | top | top | top | top | top | top |
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom |
Plain table wikitext:
{{sticky header}}
{| class="sortable sticky-header"
|+ Caption
|-
! Header !! Header 2 !! Header 3 !! Header 4
! Header 5 !! Header 6 !! Header 7 !! Header 8
! class="unsortable" | Header 9
|- class="sorttop"
| top || top || top || top || top
| top || top || top || top
⫶
|- class="sortbottom"
| bottom || bottom || bottom || bottom || bottom
| bottom || bottom || bottom || bottom
|}
Test sticky-header (sortable). Narrower tables
editHeader | Header 2 | Header 3 |
---|---|---|
top | top | top |
3 | data | b |
1 | data | c |
2 | data | a |
bottom | bottom | bottom |
Plain table:
Header | Header 2 | Header 3 |
---|---|---|
top | top | top |
3 | data | b |
1 | data | c |
2 | data | a |
bottom | bottom | bottom |
Test sticky-header. 2 rows. (sortable)
editSticky <thead>
element.
Issues:
- Nothing sticky if JavaScript disabled, which is used by sortable, currently the only way to move headers to the
<thead>
element. - Sticky
sorttop
rows, which sortable moves to the<thead>
element after sorting.
Wikitable:
Header | Header group | |||||||
---|---|---|---|---|---|---|---|---|
Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 | |
top | top | top | top | top | top | top | top | top |
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom |
Wikitable wikitext:
{{sticky header}}
{| class="wikitable sortable sticky-header"
|+ Caption
|-
! rowspan="2" | Header
! colspan="8" | Header group
|-
! Header 2 !! Header 3 !! Header 4 !! Header 5
! Header 6 !! Header 7 !! Header 8
! class="unsortable" | Header 9
|- class="sorttop"
| top || top || top || top || top
| top || top || top || top
⫶
|- class="sortbottom"
| bottom || bottom || bottom || bottom || bottom
| bottom || bottom || bottom || bottom
|}
Plain table:
Header | Header group | |||||||
---|---|---|---|---|---|---|---|---|
Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 | Header 9 | |
top | top | top | top | top | top | top | top | top |
3 | data | data | data | data | data | data | data | b |
1 | data | data | data | data | data | data | data | c |
2 | data | data | data | data | data | data | data | a |
bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom | bottom |
Plain table wikitext:
{{sticky header}}
{| class="sortable sticky-header"
|+ Caption
|-
! rowspan="2" | Header
! colspan="8" | Header group
|-
! Header 2 !! Header 3 !! Header 4 !! Header 5
! Header 6 !! Header 7 !! Header 8
! class="unsortable" | Header 9
|- class="sorttop"
| top || top || top || top || top
| top || top || top || top
⫶
|- class="sortbottom"
| bottom || bottom || bottom || bottom || bottom
| bottom || bottom || bottom || bottom
|}
Test template static row numbers (sticky-header, no caption)
editUses {{static row numbers}} with adjusted wikitable borders.
No label:
Header |
---|
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
Label:
Header |
---|
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
Test template static row numbers (sticky-header, caption)
editUses {{static row numbers}} with adjusted wikitable borders.
No label:
Header |
---|
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
Label:
Header |
---|
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
Test template static row numbers (sticky-header, sortable)
editUses {{static row numbers}} with adjusted wikitable borders.
No label:
Header |
---|
top |
top |
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
bottom |
bottom |
Label:
Header |
---|
top |
top |
rank 1 |
rank 2 |
norank 1 |
norank 2 |
rank 3 |
rank 4 |
bottom |
bottom |
Test template static row numbers. 2 rows. (sticky-header, sortable)
editUses {{static row numbers}} with adjusted wikitable borders.
No label:
Header group | |
---|---|
Header | Header |
top | top |
top | top |
rank 1 | data |
rank 2 | data |
norank 1 | data |
norank 2 | data |
rank 3 | data |
rank 4 | data |
bottom | bottom |
bottom | bottom |
Label:
Header group | |
---|---|
Header | Header |
top | top |
top | top |
rank 1 | data |
rank 2 | data |
norank 1 | data |
norank 2 | data |
rank 3 | data |
rank 4 | data |
bottom | bottom |
bottom | bottom |
Padding
editPadding for testing purposes.