Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes DIVS or TABLES Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DIVS or TABLES" Watch "DIVS or TABLES" New topic
Author

DIVS or TABLES

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The new trend is using divs, but I still am a table man.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Jan 10, 2002
Posts: 60785
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
the trick it to use % with your divs
they adjust to the browser witdh
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
I am not sure what you are talking about....
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
did you do say the the div was relative to the cell?
<div style="position:relative">
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DIVS or TABLES
 
Similar Threads
100% height does not work
Sub-header in datatable column
How to use table in div tag
Div's versus Tables
Bargraphs in HTML