Jump to content

HTML <table> model or <div> model?


inktherapy

Recommended Posts

Hi,I have a page with table layout but when I convert it to PDF the design becomes different, the result is not the same as the page itself. Columns exploded, layout is totally thrashed! I was thinking if the problem is in the layout model?Help please I need an answer and advise.Thanks!

Link to comment
Share on other sites

I always discourage the use of table for laying out websites. It's a whole lot of extra unnecessary mark-up and is not semantically correct. They are less flexible and harder to control too.Tables were a smart idea to make complex sites when CSS did not exist, but it's been over 8 years since then so people have to move on.

Link to comment
Share on other sites

Just to emphasize Ingolme's point: complex table-layouts were a pretty smart HACK before divs and CSS, but they were always a hack. The fact that there are school teachers and even college teachers who still promote that skill amazes me.

Link to comment
Share on other sites

Hi,How do you convert an HTML to PDF in adobe professional? I want the PDF to be exactly same as the HTML layout! I still can't find any answers online... this is frustrating... hehehe.

Link to comment
Share on other sites

complex table-layouts were a pretty smart HACK before divs and CSS, but they were always a hack.
Yeh, Originally tables were implemented to display data. Not layout.On the other hand, I always say that if I need to build a simple small page, then tables are OK.
Link to comment
Share on other sites

Yeh, Originally tables were implemented to display data. Not layout.On the other hand, I always say that if I need to build a simple small page, then tables are OK.
I don't see what's so hard about making a "simple page" in CSS. Really, once you're used to it, you simply cannot go back to tables.With CSS you just need to write something like this:
<div id="title"></div><div id="menu"></div><div id="main"></div><div id="footer"></div>

And add a bit of CSS:

#menu { width: 160px; float: left; }#main { margin-left: 160px; }#footer { clear: both; }

With tables that loks something like this:

<table cellpadding="0" cellspacing="0">  <tr><td colspan="2"></td></tr>  <tr>	<td class="menu"></td>	<td></td>  </tr>  <tr><td colspan="2"></td></tr></table>

with this CSS:

.menu { width: 160px; }

I don't know about you, but I just find the table method much longer and harder to do. Aside from that, if you put a really long word in the menu it's going to make the menu wider no matter what you try to do to stop it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...