How to add borders to tables?

Version 2.1 by Vincent Massol on 2018/03/16

Global Level

The Flamingo skin (and some other skins) don't show vertical borders by default. If you want to change that you can add a  StyleSheet Extension (SSX) xobject (i.e. XWiki.StyleSheetExtension) to any wiki page of your choosing (you can create a new page just for this for example), with the following content:

.main th, .main td, .wiki-table th, .wiki-table td {
   border: 1px solid #E8E8E8;
   padding: 3px 4px;

You could also decide to have some background colors for table headers by adding:

th {
   background-color: #F3F3F3;
   font-weight: 700;
}

And if you don't want the table to take the full width you could add:

table {
 width: auto;
}

Table Level

It's also possible to say that you want border just for a specific table using the table-bordered CSS class. For example in XWiki Syntax 2.0+:

(%class="table-bordered"%)
|A|B|
|C|D| 

Get Connected