Help:Wiki University Wikitext--Tables - Column headings





<< Previous Chapter Next Chapter >>

Table column headings

 * We have a title for our table, but what do the columns represent?
 * To label the columns we use exclamation marks: !
 * Unlike the caption, we have to have a row tag before the exclamation marks:

 |- !  !  !  !

 |- ! Fruits ! Vegetables ! Nuts ! Grains
 * Here are the column headings for our healthy foods table:


 * NOTICE there are no borders on column headings.
 * NOTICE the headings centered by default in the heading cell.
 * NOTICE the font is bold as well.
 * NOTICE the table border will expand as you add rows and/or column headers.

Changing column headings
Here is what the table will look like with borders, centered text and background color: Here is the coding: 
 * To put a border on the heading cells, we will use our border attribute
 * To make the headings really stand out let's add a background color as well.
 * NOTICE the width attribute was moved into the heading tags so we know where they are. They could have stayed where they were or with any other cells in the columns.

Try these out


 Exercises
 * With our above table place a yellow border, "dashed" style and 10 pixels thick.
 * Make the table 500 pixels wide.
 * Next place a blue border around the headings.
 * change our Healthy Foods caption with any font;
 * Change the background color for the headings.

Check your answers

 Quick Quiz
 * The headers are always centered on the column.
 * A. True
 * B. False


 * You can put borders in the headers column
 * A. True
 * B. False


 * Headers are always in bold type.
 * A. True
 * B. False

Check your answers

<< Previous Chapter Next Chapter >>