Help:Wiki University HTML-- Tables - Column headings

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 are by default to the left of the heading cell.
 * NOTICE the font is bold.

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
 * If you want to center the headings, we will use our text-align 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.
 * Install our Healthy Foods caption with any font;
 * Install the headings for each of the columns.
 * Install a background color for the headings.

Check your answers

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


 * You have to use the text-align to put the header on the left side
 * A. True
 * B. False


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

Check your answers