Download presentation
Presentation is loading. Please wait.
Published byGabriela Ellick Modified over 10 years ago
2
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
3
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
4
Need to format the parts Each has borders Can collapse
6
Every element in the table has a border Adjacent cells can have their own borders (default) or they can share a border (border-collapse)
7
They have width. Use margins. Elements in table can have any text align you want
8
Often need to repeat format on multiple elements CSS notation th,tr,td { border: none; }
9
CANT BE DONE IN CSS HTML attributes on td colspan=n rowspan=n
10
Borders Colors Widths Spacing Backgrounds Fonts Spacing
11
Tables will adjust columns based on content What if you want them fixed width? Fixed and same col { width: …; } Fixed and different OR class per td (but have to put it on every td)
12
What are trees? HTML tags create one! Called the DOM (Document Object Model) CSS will allow us to format selectively based on the tree
13
context tag { Applies to any tag inside context Space is a descendant selector context > tag { Applies to any tag directly inside context > is a child selector Context + tag { Applies only to a tag that DIRECTLY follows a context + is an adjacent sibling selector
14
Better to save tables for actual tables For page layout: floating divs For navigation and pictures: lists and divs
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.