Killer Tables - Blank Cells A table cell need not be occupied by a "real" object or text. In fact, blank cells are required as much as full ones to achieve the right look. There are several ways to achieve the blank cell. Blanks can be done with a one pixel gif stretched to the right width and height or the one-pixel can fill up space with vspace and hspace. A blank cell can also contain nothing at all or a simple <BR> tag. A Table with Stretched One-Pixel Gif Blanks <table border=1 cellspacing=0 cellpadding=0 width=300> <tr> <td><img width=75 height=75 border=0 SRC="images/redbox.gif"></td> <td rowspan=2><img width=150 height=1 border=0 SRC="../resources/dot_clear.gif"></td> <td><img width=75 height=75 border=0 SRC="images/orangbox.gif"></td> </tr> <tr> <td><img width=75 height=75 border=0 SRC="images/greenbox.gif"></td> <td><img width=75 height=75 border=0 SRC="images/bluebox.gif"></td> </tr> </table> A Table with vspaced One-Pixel Gif <table border=1 cellspacing=0 cellpadding=0 width=300> <tr> <td><img width=75 height=75 border=0 SRC="images/redbox.gif"></td> <td rowspan=2><img hspace=150 border=0 SRC="../resources/dot_clear.gif"></td> <td><img width=75 height=75 border=0 SRC="images/orangbox.gif"></td> </tr> <tr> <td><img width=75 height=75 border=0 SRC="images/greenbox.gif"></td> <td><img width=75 height=75 border=0 SRC="images/bluebox.gif"></td> </tr> </table> A Table with Cell Width and a <BR> Tag Notice The Table Might Collapse if the Browser Window is Made Smaller <table border=1 cellspacing=0 cellpadding=0 width=300> <tr> <td><img width=75 height=75 border=0 SRC="images/redbox.gif"></td> <td rowspan=2 width=300><BR></td> <td><img width=75 height=75 border=0 SRC="images/orangbox.gif"></td> </tr> <tr> <td><img width=75 height=75 border=0 SRC="images/greenbox.gif"></td> <td><img width=75 height=75 border=0 SRC="images/bluebox.gif"></td> </tr> </table> Note: if all you need the one-pixel gif to do is hold width, be sure to give it a height of one. The reverse is also true. In general, it is always best to specify both height and width, as Internet Explorer will break if only one is entered. Also, being specific and asking the image to resize only as much as necessary will prevent GIF expansion problems discussed in Chapter 3: Preparing Images. Next: Hard Returns Core | Top | Feedback |