navigation
Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Microsoft MVP
 

The Art of Building Tables - Part III  
by Thomas Brunt
OutFront News Article: November 29, 2000

Forcing Cell Widths

Sometimes you don’t need to be exact to the pixel on cell/column widths. It’s fine to just declare cell widths in such cases. If you need to be precise, however, just declaring pixel widths in the cell properties dialog is not enough. That usually does fine in IE but often not in Netscape 3 and 4. The table will be the right width in Netscape, but some columns will be a bit wider than they’re supposed to be and others will be a bit narrower than they’re supposed to be. You have to put something into each column to force the column out to the width you need.

For precise tables, I start with a table that has cellpadding of 0 and cellspacing of 0. If I need to create the effect of padding, I just create spacer cells for that. The key to forcing the cells to the proper width is to create an extra row at the bottom of your table. I insert into each of the cells on that bottom row a 1 pix by 1 pix clear gif image. Then, I go into the source code and change the width attribute to equal the width of the cell/column.

If you don’t know how to make a cleardot gif, I have one you can take at the following url. Just right click inside the box and select “save picture as.” http://www.outfront.net/cleardot.htm

The code for the bottom row will look like this.

<tr>
<td width=”150”><img src=”images/cleardot.gif” width=”150” height=”1”></td>
<td width=”10”><img src=”images/cleardot.gif” width=”10” height=”1”></td>
<td width=”420”><img src=”images/cleardot.gif” width=”420” height=”1”></td>
<td width=”10”><img src=”images/cleardot.gif” width=”10” height=”1”></td>
</tr>

In this case the 150 wide cell is to allow for a navigation bar column. Each of the 10 wide cells are spacer columns that act like cellpadding. The 420 wide cell is for the primary content column of the page.

I also like to put these clear gifs into any empty table cells I have because many versions of Netscape will not display a cell’s background color unless there is something in that cell. Some folks put nonbreaking spaces (spacebar) in empty cells. FrontPage often does this by default, but that forces the cell out to at least the width of the nonbreaking space. Sometimes I don’t want the cell to be that wide or that tall.


Thomas Brunt
OutFront.net
A Microsoft FrontPage Learning Community

 

<<< Part I     <<< Part II
 


Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.