To: Quix
And this:
<TABLE BORDER=3 WIDTH=75%>
<TR>
<TD>1st row</TD><TD>Cell</TD>
</TR>
<TR>
<TD>2nd row</TD><TD>Cell</TD>
</TR>
</TABLE>
Gives you this:
1st row |
Cell |
2nd row |
Cell |
To: TaxRelief
A few more goodies:
- Tables have cellpadding and cellspacing properties which set the amount of space between cells, and the amount of margin within each cell. These properties may also be applied to individual table rows or items.
- Tables have bgcolor and background properties; the former takes a color (either as a name, e.g. "white", or as a six-digit hex number preceded by a pound sign, e.g. "#FFFFFF"), while the latter takes a url which points to a picture. If you are going to use the latter, it is often good to use the former as well to establish the 'dominant' color of the picture before the image itself is loaded. This is especially important if the picture itself has a dark background.
- Tables can be nested within tables. Although this may at times seem confusing, it can also simplify things. The bar-graph example above, e.g., uses nested tables. It would be possible to do such a thing without nesting tables (using colspan, below) but it would be a pain.
- Sometimes tables need to have cells that span multiple rows. The rowspan and colspan properties are useful for this. E.g. Note that if a cell uses colspan, the included cells should be skipped [there are no [td] items for them]. If a cell uses rowspan, the included cell(s) should be skipped from succeeding rows.
Although it's possible to combine rowspan and colspan in such a way as to produce malformed tables, the results are not predictable or consistent.
- Sometimes it's useful to have a table with an exterior border but no interior lines. This can be done using the rules property, though I don't know all the variations. One shown here, though, is rules=none
- If no widths are specified for a table or its cells, the table will be as narrow it can be without causing any word wrap. If word wrap is unavoidable, the rules get complicated. In the event that certain parts of the table have their width manually set, browsers will generally try to make sense of the rest, but different browsers follow different rules.
A typical behavior would be to allocate the manually-set widths, then allocate any 'minimum' widths necessary to avoid word wrap, and then allocate what's left. As an example:
Hey |
This is a very long cell |
OK |
This is another very long cell. Longer, even, than the first. |
In this example, the table width is fixed at 400, and the gray cell is fixed at 100. The other cells are adjusted to try to fit what can be accommodated. -
A table may use the properties align=left or align=right to allow placement as a really cool floating object like the one shown at right. Such tables should generally only be used if they're fairly small, since strange things can happen if they're so wide that things don't really fit. Used sparingly, however, they can help conserve vertical space.
- And finally...
VEN such cool things as drop-caps can be produced if one uses tables successfully. The effectiveness of drop caps can be enhanced using other style properties, but they are unfortunately not allowed in FreeRepublic. Despite the limitations, the effet can still be pleasing. This paragraph is enclosed in a fixed-width table to ensure that it is long enough to demonstrate wrapping around the table. |
Hope you like those goodies.
283 posted on
04/09/2005 10:03:12 PM PDT by
supercat
("Though her life has been sold for corrupt men's gold, she refuses to give up the ghost.")
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson