Help:Table
![]() | This page is a how-to guide detailing a practice or process on the wiki. |
- For a basic introduction, see the Introduction to tables on Wikipedia. For style considerations, see Manual of Style/Tables, also on Wikipedia.
A table is an arrangement of columns and rows used to organize and position data. Tables can be created on wiki pages using special wikitext syntax, and there are many different styles and tricks that can be used to customise them.
Bogleheads wiki specifics
The Wikipedia standard for tables uses class="wikitable"
and can get automatically generated by using the table button on the Edit toolbar, which results in:
Header text | Header text | Header text |
---|---|---|
Example | Example | Example |
Example | Example | Example |
Example | Example | Example |
The same table using the {{Table}}, which is intended is used to standardize the appearance of Excel to Wiki generated tables, results in:
Header text | Header text | Header text |
---|---|---|
Example | Example | Example |
Example | Example | Example |
Example | Example | Example |
Clearly there is an inconsistency in the format depending on which method is used. Editors are reminded to exercise careful consideration before choosing which method is used. For consistency reasons, the general guideline for the wiki is to follow Wikipedia's Manual of Style.
Centering the columns of a table
If you want to have columns centered in a table, then add style="text-align:center"
after class="wikitable"
which results in:
Header text | Header text | Header text |
---|---|---|
Example | Example | Example |
Example | Example | Example |
Example | Example | Example |
Sortable tables
Tables can be made sortable by adding the CSS sortable; for details see Help:Sorting. Since this can be very useful, it is wise to keep the possibilities and limitations of this feature in mind when designing a table.
Sortable wikitables look like this:
name | data | more data |
---|---|---|
cats | 273 | 53 |
dogs | 65 | 8,492 |
mice | 1,649 | 548 |
Row highlighting
class="mw-datatable"
allows for row highlighting. This makes it easier to follow the data and info across a row, especially in wider tables. Scroll your cursor over the tables below to see the light blue banding in the tables with class="mw-datatable"
.
name | data | more data |
---|---|---|
cats | 273 | 53 |
dogs | 65 | 8,492 |
mice | 1,649 | 548 |
Create tables from a spreadsheet
Use excel2wiki, the Excel xls to wiki copy and paste converter for Wikipedia and Mediawiki.
See also
- Help:Editing
- Help:Tables (Wikipedia)
- Help:Table/Sortable tables (Wikipedia)
External links
- TablesGenerator.com, Generate tables in MediaWiki format
|