Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DIVS or TABLES

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While designing a site, I have encountered problems when mixing DIV tags for Menus and TABLES.
So my questions is this. Disregard browser compatability, what are everyone's opinions on using DIVS instead of TABLES through out an entire web site?
Also, if anyone has any pointers on how to mix DIVS and TABLES together, that would be even better.
Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The new trend is using divs, but I still am a table man.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem I have with DIVS is it seems like everything on the page is so static in its positioning. So if I am worrying about desktop resolution, I have to make my page fit 1024x768. And any finer resolution, the page just looks empty.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tend to use mostly divs, but for some things I need to resort to tables since IE is pretty bad at some of the advanced CSS positioning directives. This is especially apparent when trying to right or bottom justify things.
Sigh.
What specific problems are you having mixing them? Mine live in harmony when I need to resort to tables.
bear
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my main problem is when I need to add my DHTML menu. I would like each of my MenuItems to each be in a table cell. And then the drop down part would reside in a DIV. The problem is, when the MenuItems are in a DIV, I have to position them on the page and not in the <TD>. Even when you put a DIV between a <TD></TD>, it really doesn't matter. You still have to position your DIV relative to the page and not relative to the <TD>.
Does that make sense?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the trick it to use % with your divs
they adjust to the browser witdh
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am more concern with LEFT and TOP. It's easy to just center a TABLE in the middle of the page, or more towards what I am looking for, I can center a Table in a <TD> relative to that <TD>.
I haven't found a way to do this with <DIV> yet.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what you are talking about....
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, let me explain my problem with what I am doing.
I have a DHTML menu. That menu is part of a header file called main_header.inc.jsp.
Since my menu consists of a bunch of DIV tags, the header file by itself looks fine. But when that file is included with my other pages the menu is out of place. I am sure it is because of the absolute positioning, but I don't know how to solve my problem. What I am talking about with the Table issue is the fact that if I did something like the folloing:

The div element, since it is a layer, does not actually position itself inside relative to the <td></td>. It is still relative to the page.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you do say the the div was relative to the cell?
<div style="position:relative">
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic