Template:Row hover highlight
| Template documentation follows |
|---|
| Note: the template above may sometimes be partially or fully invisible. |
| Visit "Template:Row hover highlight/doc" to edit its documentation if it is available. (How does this work?) |
| This template is used on approximately 2,900 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.
This template adds hover highlighting to table rows, making it easier to track a row in wide or tall tables.
Usage
Place {{row hover highlight}} or its redirect {{mw-datatable}} above the table. Add one of the following classes to the table start markup.
| Class | Summary |
|---|---|
hover-highlight
|
Cell backgrounds unchanged. Row highlights when pointer is over. |
mw-datatable
|
Cell backgrounds white. Row highlights when pointer is over. |
Header cells unaffected when used with the wikitable class.
Using hover-highlight
Wikitext
{{row hover highlight}}
{| class="wikitable hover-highlight"
|+ Caption
|-
! 0 !! 1 !! 2 !! 3
|-
! 1
| 1-1 || 2-1 || 3-1
|-
! 2
| 1-2 || 2-2 || 3-2
|}
Produces
| 0 | 1 | 2 | 3 |
|---|---|---|---|
| 1 | 1-1 | 2-1 | 3-1 |
| 2 | 1-2 | 2-2 | 3-2 |
Using mw-datatable
Wikitext
{{row hover highlight}}
{| class="wikitable mw-datatable"
|+ Caption
|-
! 0 !! 1 !! 2 !! 3
|-
! 1
| 1-1 || 2-1 || 3-1
|-
! 2
| 1-2 || 2-2 || 3-2
|}
Produces
| 0 | 1 | 2 | 3 |
|---|---|---|---|
| 1 | 1-1 | 2-1 | 3-1 |
| 2 | 1-2 | 2-2 | 3-2 |
See also
- Help:Table/Advanced § Highlight rows on hover
- {{shy}} – Can be used to help narrow columns by adding a soft hyphen to a word to allow it to wrap.
More template styles for tables:
- {{sticky header}} - makes column headers stick to the top of the page while scrolling through table data.
- {{sort under}} - moves the sorting arrows under the headers.
- {{static row numbers}} - adds a column of row numbers to a table.
- {{table alignment}} - aligns the cells in a column, or a whole table.