Template:Row hover highlight
From TechInfoDepot
Jump to navigationJump to searchThis template uses TemplateStyles: |
This template enables Template:Background color via wikitable class modifiers Template:Type and Template:Type.
In addition to adding row highlights, Template:Type also changes the background of the cells to white. To only add a highlight, use Template:Type.
Usage. {{row hover highlight}}
Basic usage:
Wikitext
{{row hover highlight}}
{| class=mw-datatable
|-
! 1 !! 2 !! 3
|-
| 1-1 || 2-1 || 3-1
|-
| 1-2 || 2-2 || 3-2
|}
Rendered result
1 | 2 | 3 |
---|---|---|
1-1 | 2-1 | 3-1 |
1-2 | 2-2 | 3-2 |
class=mw-datatable
can be used in combination with class=wikitable
, in which case the non-header cells will have a white background.
Wikitext
{{row hover highlight}}
{| class="wikitable mw-datatable"
|-
! 1 !! 2 !! 3
|-
| 1-1 || 2-1 || 3-1
|-
| 1-2 || 2-2 || 3-2
|}
Rendered result
1 | 2 | 3 |
---|---|---|
1-1 | 2-1 | 3-1 |
1-2 | 2-2 | 3-2 |
To keep the light gray background from class=wikitable
, use class=hover-highlight
:
Wikitext
{{row hover highlight}}
{| class="wikitable hover-highlight"
|-
! 1 !! 2 !! 3
|-
| 1-1 || 2-1 || 3-1
|-
| 1-2 || 2-2 || 3-2
|}
Rendered result
1 | 2 | 3 |
---|---|---|
1-1 | 2-1 | 3-1 |
1-2 | 2-2 | 3-2 |
Usage. {{mw-datatable}}
If you want a white background for data cells, then this may be easier to remember since the template and class name are the same.
Wikitext
{{mw-datatable}}
{| class="wikitable mw-datatable"
|-
! 1 !! 2 !! 3
|-
| 1-1 || 2-1 || 3-1
|-
| 1-2 || 2-2 || 3-2
|}
Rendered result
1 | 2 | 3 |
---|---|---|
1-1 | 2-1 | 3-1 |
1-2 | 2-2 | 3-2 |
See also
The above documentation is transcluded from Template:Row hover highlight/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |