Diferencia entre revisiones de «Plantilla:Row hover highlight/doc»
Template:Row hover highlight/doc>Timeshifter (Substitute display:inline-grid; for display:inline-table; - See Help:Table.) |
m (1 revision imported) |
(Sin diferencias)
|
Revisión actual - 01:46 10 feb 2024
This is a documentation subpage for Plantilla:Row hover highlight. It contains usage information, categories and other content that is not part of the original plantilla page. |
Error de Lua en Módulo:TNT en la línea 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab. This template enables row hover highlighting via wikitable class modifiers mw-datatable and hover-highlight.
In addition to adding row highlights, mw-datatable also changes the background of the cells to white. To only add a highlight, use hover-highlight.
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