HTML Tutorial 12
Prepared by: Anthony Larrain
Tables II
- Tables can also be used for web page layout.
- Note this is an area of debate. W3C recommends using CSS for layout.
- See table9.html. Don't forget to view the source.
- Notice the data in the right hand cell is placed in the middle by default.
- Can use the
valign
attribute with valuestop, middle, bottom
to control the vertical alignment of the data in the cell.
Example 1
- See table10.html. Don't forget to view the source.
Design Tip
- Use CSS to style the page
- See table10style.html. Don't forget to view the source.
Column Width
- Can specify the width of each table cell using the
width
attribute. - Can use either pixels or percentages.
- Percentages are relative to the width of the table.
Example 2
10% | 20% | 30% | 15% | 25% |
10% | 20% | 30% | 15% | 25% |