How To Use Tables

Wikitable Class
The "wikitable" class provides a nice looking table without having to remember or specify all the details each time you create a table. This is because the wikitable class in MediaWiki:Common.css contains a number of table.wikitable CSS style rules. These are all applied at once when you mark a table with this class. You can then add additional style rules if desired. These override the class's rules, allowing you to use the class style as a base and build up on it.

{|cellpadding=20 
 * -valign=top
 * Code:
 * Result:


 * }

Sorting
Tables can be made sortable by adding. For more details see Help:Sorting. If the table already has a class qualifier add sortable separated by a space, for example.

{|cellpadding=20 
 * -valign=top
 * Code:
 * Result:


 * }

Frames
This example demonstrates how to use the "frame" attribute to control the borders around a table. The thickness of the lines can be specified using "border" and the width in pixels. The frame feature is only supported in modern browsers. The first nine examples change only the frame parameter, the last three also change the border:

