Help:Tables/Wikitext

If you want to shape tables with wikitext, you have plenty of options. This one page won't go into them all, but it will show you how wikitext matches up to HTML markup, the difference a CSS class makes, and an example of a simple table that works on both desktop and mobile devices.

Basic table code
Wikitext is, in many ways, just shortcut for HTML. If you're familiar with HTML, you probably already know how to build a wikitext table. Here's a chart that will help you understand the connection between wikitext and HTML:

Fandom's default CSS classes
There are several default table classes on Fandom, that style the table. To add them, simply do: {| class=" " and replace " " with the classes below.

Note: All tables in mobile are automatically set to, even if you set a specific table class.

Here are the default classes of Fandom:
 * - Makes a grid-like layout, with no styling. (Don't use it for design!!!)
 * - Default MediaWiki styling of tables. Adds a simple border to all rows/columns. On table headers, it fills the background with a grey color.
 * - A modern-like table design. Adds a border to seperate rows (gutter), and colors all rows with a semi-transparent grey color. The header cells are colored grey, similar to
 * - Similar design with, but with bigger padding. Has a sticky header, too.

Here is an example of the table classes in action:

Basic tables
As explained elsewhere, tables don't always display well on mobile web.

The best approach is to keep things as simple as possible. Look at the following wikitext, and then notice, on your phone, how the table works on that smaller display:

...which gives:

More advanced table coding
Tables can be made significantly more advanced than the example above. If you want to explore other options for wikitext tables, you could start by consulting the MediaWiki help page for tables. But remember that much of what you'll see in places like mediawiki.org or Wikipedia's help page don't really consider the effects of tables in mobile. It's important to always check your work with tables on an actual phone to see how well it displays for the many mobile readers of your wiki.

It is also possible, in some specific use cases where data needs to be calculated, to use templates or even to use Lua-based templates, both to create pre-existing table structures, or to use templates within cells.

Further help and feedback
de:Hilfe:Tabellen/Wikitext es:Ayuda:Wikitexto/Ejemplos de tablas fr:Aide:Tableaux/Wikitexte it:Aiuto:Tabelle/Wikitext ja:ヘルプ:テーブル/ウィキテキスト ko:도움말:위키 문법/표 예제 pt:Ajuda:Wikitexto/Exemplos de tabelas ru:Справка:Таблицы/викитекст tr:Yardım:Tablolar/Vikimetin uk:Довідка:Таблиці/вікітекст zh:Help:Wiki文本/表格的例子