Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything › Text › Lists › Other tables › Pictures › …
Required › Table › Row › Data Optional elements › Header (replaces data) › Caption For multipage tables › Thead (contains rows) › Tfoot (contains rows) › Tbody (contains rows) REQUIRED if thead or tfoot
Borders › Colors › Widths › Spacing Backgrounds Fonts Spacing
Every element in the table has a border Adjacent cells can have their own borders (default) or they can share a border (border-collapse)
Often need to repeat format on multiple elements CSS notation th,tr,td { border: none; }
Tables will adjust columns based on content What if you want them fixed width? › Fixed and same td { width: …; } › Fixed and different class per td (but have to put it on every td) (will look at better alternative next week)
They have width. Use margins. Elements in table can have any text align you want Remember display: table;
CAN’T BE DONE IN CSS HTML attributes on td › colspan=“n” › rowspan=“n”
Better to save tables for actual tables For page layout: floating divs For navigation and pictures: lists and divs