The Tables Tips 'n' Tricks


Some examples first

1.) The multicolor table

redyellow
greenblue

And this is the code for it:
<table cellpadding=1 cellspacing=1 border=2 width=200>
<tr><td bgcolor=#ff0000>
red</td>
<td bgcolor=#ffff80>
yellow</td></tr>
<tr><td bgcolor=#80ff00>
green</td>
<td bgcolor=#0000ff>
blue</td></tr>
</table>



2.) The colspan and rowspan command

two columnsone column
just a cell 1just a cell 2two rows
just a cell 3just a cell 4

And this is the code for it:
<table cellpadding=10 cellspacing=1 border=1 width="50%">
<tr><td colspan=2>
this cell goes over two columns</td>
<td>
one column</td></tr>
<tr><td>>
just a cell 1</td>
<td>>
just a cell 2</td>
<td rowspan=2>
this cell goes over two rows</td></tr>
<tr><td>
just a cell 3<tt></td>
<td>just a cell 4</td></tr>
</table>



3.) Text and image alignment with (borderless) tables


If you want to have two images aligned on the same line, like here,
you'll have to use another table trick:
image comment 1 the "invisible table" image comment 2

And this is the code for it:
<table border="0" width="100%">
<tr><td align="left"><img src="../bilder/athens.gif"></td>
<td align="center" valign="top">
If you want to have two images aligned on the same line, like here,<br>you'll have to use another table trick:</td>
<td align="right"><img src="../bilder/athens.gif"></td></tr>
<tr><td align="left">
image comment 1</td>
<td align="center" valign="middle">
the "invisible table"</td>
<td align="right">
image comment 2</td></tr></table>



4.) A few tips and tricks more...

If you have any questions, please do not hesitate to write me an email.



Made 1998 by wohli (Jan Wohlgemuth).


Hosted by www.Geocities.ws

1