• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Adding a table inside a div makes all hell break loose

Red Squirrel

No Lifer
EDIT: nevermind... noob move. I had a <table> that should really be a </table>. I just assumed all the other templates were fine because I figured a mistake like that would cause much bigger issues. All good now.

Been trying to move away from using tables for layout, but tables are still way better at actual tabular data, as you don't want to use absolute and depend on the font size being the same on every machine not to mention the text is dynamic so you want things to flow properly and not start to overlap and crap. So using a table in this situation is a must.

However I noticed that if I put a table in a div, it breaks everything. It's like if it forces the div to stop prematurely.

Take a look at this site for example:

http://www.tiffanystakeout.ca

The home page has a light yellow background, that is a div.

If I add a table in there, it makes the yellow portion stop right before the table. If you click on menu you can see that effect. The part at the bottom that says printer friendly page should all be in the same light yellow colour but it's not.

Why does it do that? I want the table INSIDE the div, not after it, and I even coded it that way, but for some reason it's just not working.
 
Last edited:
Better for ones peace of mind, etc to find out the issue on your own rather than it being pointed out to you when a typo is the issue. 😛
 
in general, i'd stay away from tables as a whole when doing HTML now a days.

Depends on what you are doing. If you have tabular data you should probably use tables.

That said, tables should be shallow. Having sub tables in a table is a sign that you probably didn't actually want to use a table.
 
in general, i'd stay away from tables as a whole when doing HTML now a days.

What?
What do you propose will replace a table? A div? if a div could replace a table then you weren't using a table for what it was meant to be "now a days".
 
What?
What do you propose will replace a table? A div? if a div could replace a table then you weren't using a table for what it was meant to be "now a days".

Divs can replace properly used tables. It isn't hard to do. But your html ends up looking something like this

HTML:
<div class="table">
  <div class="tr">
    <div class="td"></div>
  </div>
</div>

Like I said earlier. If you have tabular data, use a table. Just don't use it for layout (unless you are dealing with Outlook 2005 and IE6... poor soul...)
 
Your over my head atm on this one I guess, but I usually just do MasterCam.

I'm a lowly CNC programmer 🙂
 
Back
Top