W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2002

Re: Empty <div> tags

From: Charles Reitzel <creitzel@rcn.com>
Date: Tue, 17 Dec 2002 11:41:47 -0500
Message-Id: <>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: html-tidy@w3.org

At 06:35 AM 12/17/2002 +0100, Bjoern Hoehrmann wrote:

>* Charles Reitzel wrote:
> >Ok, I see what you mean.  Is this behavior specific to DIV or would it
> >apply to other block level tags?  What about PRE, BLOCKQUOTE, CENTER?
> >
> > Empty TD elements have meaning as placeholders.  However empty TDs
> > should probably be handled the same way as empty Ps: insert a &nbsp;
> > This is my standard hand-coding practice to make tables w/ empty
> > cells look OK.
>Empty <p> elements get dropped, empty <td>s should stay empty <td>s.
>Inserting &nbsp;s is considered rather harmful.

Interesting.  I have never heard this before.  Can you elaborate?  What are 
the side effects?

When generating HTML from web apps (Perl/JSP), I have always found it 
necessary to make sure all cells have something in them, either via rowspan 
or by adding &nbsp;.  If you leave them empty, you get visual "holes" 
through the table to the background.  If any styles are applied to the 
table, it looks weird.  To see an example, have a look at the table for 
binaries on the Tidy home page.  Admittedly, this is just a hack I have 
picked up and not based on any deeper theory.

Received on Tuesday, 17 December 2002 11:37:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:52 UTC