Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Bug rendering tables with row height="0"

The built-in editor ignores my formatting for the 1st row to have zero height. My table HTML are as follows.

<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=1>

<TR>
<TD WIDTH="200" HEIGHT="0"></TD>
<TD WIDTH="200" HEIGHT="0"></TD>
<TD WIDTH="200" HEIGHT="0"></TD>
</TR>


<TR>
<TD colspan=2 WIDTH="400">EXTRA SPACE</TD>
<TD WIDTH="200" ALIGN=CENTER>width<BR>(should be 200 pix)</TD>
</TR>


<TR>
<TD WIDTH="200" ALIGN=CENTER>width<BR>(should be 200 pix)</TD>
<TD colspan=2 WIDTH="400">EXTRA SPACE</TD>
</TR>

I use this zero height code to control the format of column spans for my page layout.

Fong Fatt Chee
Tuesday, January 08, 2002

It is a bug that the editor shows you the first row with full height, although arguably this is for a good reason -- in case you want to put something inside one of those rows there needs to be room to click! But CityDesk *will* preserve your height="0" specification so it will publish the way you intended.

I don't think the 0-row-height trick works perfectly, anyway - with Netscape and IE it makes a fatter border on the top of the table. This may not matter to you if you turn borders off (although I think you still get a blank 1 pixel row at the top of the table). Many web designers use spacer gifs (a 1x1 transparent gif, sized to the appropriate width) in their first row to get the same effect which solves both problems.

Joel Spolsky
Wednesday, January 09, 2002

I've never understood this.  Your zero row height HTML works in my Netscape Navigator, but not in FrontPage, IE, or CityDesk.  I've always had to use a tiny spacer gif to make my rows heights the size I wanted.

TK
Wednesday, January 09, 2002

I work with tables for layout bcos it's easier for me to write HTML than to work with more "exotic" methods - I am not a professional web designer. The wysiwyg editor's inconsistent behaviour "broke" my metal model of what "should" happen hence I called it a bug.

I turn-off the border hence tables does work for me in IE more correctly than using CSS layout . my target browser is IE5.5.

I don't like using spacers as it breaks the seperation of "content", "structure", "style" model.

Fong Fatt Chee
Thursday, January 10, 2002

IMO, as soon as you have "height=" in your table, you've intermingled content and presentation.

Set your document to XHTML 1.0 Strict and then run it through the W3 validator. This really will make you remove all presentation from your HTML.

Brad Wilson
Thursday, January 10, 2002

*  Recent Topics

*  Fog Creek Home