Jump to content

Template:Static row numbers/testcases

From Wikipedia, the free encyclopedia

Uses {{static row numbers/sandbox}}. Note that it's not possible to compare the live and sandbox versions of styles.css on the same page since they would compete with each other.

Test ranking on sortable wikitable

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| class="wikitable sortable static-row-numbers"
|+ Caption
|-
! Header
|- class="sorttop static-row-header"
| '''Top 1'''
|- class="sorttop static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="sortbottom static-row-header"
| '''Bottom 1'''
|- class="sortbottom static-row-header"
| '''Bottom 2'''
|}

Test ranking on sortable plain table with borders

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| border="1" class="sortable static-row-numbers"
|+ Caption
|-
! Header
|- class="sorttop static-row-header"
| '''Top 1'''
|- class="sorttop static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="sortbottom static-row-header"
| '''Bottom 1'''
|- class="sortbottom static-row-header"
| '''Bottom 2'''
|}

Test ranking on sortable plain table without borders

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| class="sortable static-row-numbers"
|+ Caption
|-
! Header
|- class="sorttop static-row-header"
| '''Top 1'''
|- class="sorttop static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="sortbottom static-row-header"
| '''Bottom 1'''
|- class="sortbottom static-row-header"
| '''Bottom 2'''
|}

Test ranking on wikitable

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| class="wikitable static-row-numbers"
|+ Caption
|-
! Header
|- class="static-row-header"
| '''Top 1'''
|- class="static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="static-row-header"
| '''Bottom 1'''
|- class="static-row-header"
| '''Bottom 2'''
|}

Test ranking on plain table with borders

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| border="1" class="static-row-numbers"
|+ Caption
|-
! Header
|- class="static-row-header"
| '''Top 1'''
|- class="static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="static-row-header"
| '''Bottom 1'''
|- class="static-row-header"
| '''Bottom 2'''
|}

Test ranking on plain table without borders

[edit]

Produces:

Caption
Header
Top 1
Top 2
Rank 1
Rank 2
Norank 1
Norank 2
Rank 3
Rank 4
Bottom 1
Bottom 2

Wikitext:

{{Static row numbers/sandbox}}
{| class="static-row-numbers"
|+ Caption
|-
! Header
|- class="static-row-header"
| '''Top 1'''
|- class="static-row-header"
| '''Top 2'''
|-
| Rank 1
|-
| Rank 2
|- class="static-row-numbers-norank"
| Norank 1
|- class="static-row-numbers-norank"
| Norank 2
|-
| Rank 3
|-
| Rank 4
|- class="static-row-header"
| '''Bottom 1'''
|- class="static-row-header"
| '''Bottom 2'''
|}

Test first row auto no-rank on sortable wikitable

[edit]

Produces:

Caption
Header
Data
Data

Wikitext:

{{Static row numbers/sandbox}}
{| class="wikitable sortable static-row-numbers"
|+ Caption
|-
! Header
|-
| Data
|-
| Data
|}

Test first row auto no-rank on sortable plain table

[edit]

Plain table border added to aid comparison.

Produces:

Caption
Header
Data
Data

Wikitext:

{{Static row numbers/sandbox}}
{| border="1" class="sortable static-row-numbers"
|+ Caption
|-
! Header
|-
| Data
|-
| Data
|}

Test first row auto no-rank on wikitable

[edit]

Produces:

Caption
Header
Data
Data

Wikitext:

{{Static row numbers/sandbox}}
{| class="wikitable static-row-numbers"
|+ Caption
|-
! Header
|-
| Data
|-
| Data
|}

Test first row auto no-rank on plain table

[edit]

Plain table border added to aid comparison.

Produces:

Caption
Header
Data
Data

Wikitext:

{{Static row numbers/sandbox}}
{| border="1" class="static-row-numbers"
|+ Caption
|-
! Header
|-
| Data
|-
| Data
|}

Test column label on sortable wikitable

[edit]

Uses static-row-header-hash class to display hash ("#") text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Uses static-row-header-text class to display "No." text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Test column label on sortable plain table

[edit]

Plain table border added to aid comparison.

Uses static-row-header-hash class to display hash ("#") text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Uses static-row-header-text class to display "No." text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Test column label on wikitable

[edit]

Uses static-row-header-hash class to display hash ("#") text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Uses static-row-header-text class to display "No." text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Test column label on plain table

[edit]

Plain table border added to aid comparison.

Uses static-row-header-hash class to display hash ("#") text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Uses static-row-header-text class to display "No." text:

Caption
Header 1 Header group 1 Header group 2 (long to see alignment when wrapped on narrow screen)
Header 2 Header 3 Header 4 Header 5 Header 6
Data Data Data Data Data Data
Data Data Data Data Data Data

Test template row hover highlight

[edit]

Uses {{row hover highlight}}.

In the Timeless skin, plain tables with the mw-datatable class and without the border attribute have borders. This template fixes the missing borders in the numbers column.

border
Header
Data
Data
no border
Header
Data
Data