HTML Tables and Line Breaks

HTML Tables and Line Breaks

Post by Nathan Sok » Wed, 10 Nov 2004 11:57:03

I have an HTML table, and would like to know how to place the next element
immediately below it. I thought that the BR tag was supposed to do this, but
I had to use multiple BR tags before the next element appeared on the next
line. This may work as a temporary workaround, but it makes it somewhat of a
pain to update the table if I add more rows. I suspect that this has
something to do with the table being a block element and the BR and text
being inline elements. Any help would be appreciated. Thanks.
Nathan Sokalski

HTML Tables and Line Breaks

Post by Kody Brow » Thu, 11 Nov 2004 06:42:56

The simplest way would be to set the display attribute to block, which would
force everything following the table to come below.

<table style="display:block;">...</table>

Knowingly your affinity for HTML-only solutions (8^), I suggest putting your
element inside another table with its width set to 100%, no padding, etc.
The outer table would block anything from showing up to the right of the
inner table.

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<table> ... </table>

Good luck!