This web page is going to continue looking at tables.
Now lets look at putting captions on the table and on the columns:
A caption on the whole table is done with the CAPTION command. Note that
the caption can be either at the top or bottom of the table (ALIGN=BOTTOM
puts the caption underneath the table). The TH command creates column
headers.
This is the sample table complete with caption
COLUMN #1 |
COLUMN #2 |
First row, first column |
First row, second column |
Second row, first column |
Second row, second column |
This is the sample table complete with caption
ROW #S |
COLUMN #1 |
COLUMN #2 |
First row |
First row, first column |
First row, second column |
Second row |
Second row, first column |
Second row, second column |
Notice that things designated with the TH are in bold to stand out as
row and column headers while things designated as TD are not bold - they
are the data.
You can alter the BORDER on the table and you can use CELLPADDING to
leave a little space inside, between the border and the data in the cell.
COLUMN #1 |
COLUMN #2 |
First row, first column |
First row, second column |
Second row, first column |
Second row, second column |
COLUMN #1 |
COLUMN #2 |
First row, first column |
First row, second column |
Second row, first column |
Second row, second column |
Notes on data alignment options
- If you use an ALIGN (LEFT, RIGHT, CENTER) clause within the TR, the
data within that row will be horizontally aligned
- If you want to use vertical alignment than use the VALIGN clause
within the TR
- You can also use ALIGN with TOP or BOTTOM within the TD
This is the sample table complete with caption
ROW #S |
COLUMN #1 |
COLUMN #2 |
First row |
1,1 |
1,2 |
Second row |
2,1 |
2,2 |
Third row |
3,1 |
3,2 |