|
HOME articles tutorials tool directory books about |
|
|||||||||||||||||
|
Our Other Sites
|
Using Tables as a Layout Tool (continued)Cellspacing and CellpaddingTwo other very useful <TABLE> attributes are cellspacing and cellpadding. These allow you to add a bit of white space into the table design so that the contents of different cells are as separated (or close together) as you wish. It's easy to confuse these two attributes, which accomplish this "spacing out" task in different ways.
The cellspacing attribute controls the width of the cell border. This means it controls the space between cells. The cellpadding attribute, on the other hand, controls the spacing between the contents of a cell and the edge of that cell. The illustration below makes the difference a bit clearer.
You can also affect the format of table rows and individual data cells. Attributes included in the <TR> tag affect only the cells in that row. Attributes added to a <TD> tag affect only that data cell. The attributes that apply to rows are align and valign. Align works the same way as it does for the table, but at a row level. Use it to set the contents (cells) of a particular row to align at the left, right, or center. Valign stands for vertical alignment. Use the valign attribute to specify whether the cells in a row will align at the top, middle, or bottom of the row. The cell (or <TD>) level has the most attributes. This includes the same align and valign attributes and values just discussed for rows, but when used inside a <TD> tag they affect only a single cell. If you're planning to use a two-column model to lay out your Web pages, this is where you set the width of each of those columns. Using a new attribute, bgcolor, you can also set the background color of the navigation column to be different from the background color of the main contents column. |
|
||||||||||||||||
|
HOME articles tutorials tool directory books about (c) copyright 2000-2010 Anventure. All
Rights Reserved.
|
||||||||||||||||||