Help:Wiki University Wikitext--Tables - Captions

Table captions
So far we have learned how to determine the width of our table and the type of border it will have, but we don't know what the table is about. It needs a title or a wikitext caption.

Caption tag
|+ The tag is a pipe and a plus sign: |+
 * It does not need a |- before it.

Let's call our table "Healthy Foods"
 * We will use the table with a width of 100% and the columns set at 25%.
 * Here's how the table will look with a caption:

Here's the coding:
 * NOTICE the caption is now centered over the table.


 * NOTICE all that was added was the caption tag.

Font size
 To enlarge the caption, we use our font-size attribute. Let's increase the font to 24 pixels.
 * First notice that the caption is rather small print.

Here's the coding for the caption:  |+ style=" font-size: 24px "|Healthy Foods

Change font of caption
 
 * The font you see in the table caption is the default font. If you want to change it, we can use our font-family attribute.
 * Let's change the font to "new times roman" font.
 * Here is the complete code for all the changes we have made to the caption:
 * AGAIN NOTICE the attributes are separated by semi-colons.

Try these out


 Exercises
 * With our above table place a orange border, "outset" style and 25 pixels thick.
 * Make the table 85% in width.
 * Next place a border around the cells in the first column.
 * Make all the columns the same width.
 * Install our Healthy Foods caption;
 * Font - Curtz MT
 * Font - 28pt
 * Center caption
 * 20 pixel space between caption and top of table

Check your answers

 Quick Quiz
 * The order of attributes is critical.
 * A. True
 * B. False


 * The caption can only be on the left side of the page
 * A. True
 * B. False


 * Only margin-bottom of the caption will cause the separation between the caption and the table
 * A. True
 * B. False

Check your answers