homepage Welcome to WebmasterWorld Guest from 54.83.133.189
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
Divs Within Tables?
Tips for using divs within tables please?
organic21




msg:1221422
 12:01 pm on Apr 16, 2003 (gmt 0)

Hi everyone

Moving from tables for layout to css layout is a big step
i want to get away from using tables whitin tables.
rather use divs within tables
my content, navigation is around tables
getting away from that would be a huge step that i dont want to go now

any suggestions or comments on using divs within tables, i could not think of a way to position the divs since i have used tables to position everything.

thank You all

 

DrDoc




msg:1221423
 8:42 pm on Apr 16, 2003 (gmt 0)

Welcome [webmasterworld.com] to Webmaster World! :)

Now, the wonderful thing about divs and CSS is that very little positioning is needed. A simple example of a fluid layout, using only divs and CSS:

<div id="content"></div>
<div id="navigation"></div>

<style type="text/css">
#content {
position: absolute;
top: 0px;
left: 150px;
}
#nav {
width: 150px;
}
</style>

Or, if you want three columns:

<div id="content"></div>
<div id="nav-left"></div>
<div id="nav-right"></div>

<style type="text/css">
#content {
position: absolute;
top: 0px;
left: 0px;
margin: 0px 150px;
}
#nav-left {
float: left;
width: 150px;
}
#nav-right {
float: right;
width: 150px;
}
</style>

If you want other divs inside the content div it is easy to make it look good by assigning either a height or width (preferably not both), or to use absolute positioning.

Birdman




msg:1221424
 8:46 pm on Apr 16, 2003 (gmt 0)

Welcome to Webmaster World. You will want to read Nick's CSS Crash Course [webmasterworld.com]. It will get you started in the right direction.

organic21




msg:1221425
 2:36 pm on Apr 17, 2003 (gmt 0)

Hi everyone. thanks for help btw

I have discovered all that and my main problem is that i have used tables around everything to position my website.
using absolute positioning for the divs will not work together with all the tables i have around them.

So basically speaking, i have to place the divs within the tables in order to positon them relatively to the tables.

That means i am not able to use absolute div positioning. The layout will not look the way i want it to.
I would get around all that using a css only layout, which would be a big step and i am not ready to go there yet.

My question is, if it is acceptable to use divs within tables and does it have any disatvanatges? browser cross compatibility. i checked it out yeserday and everything seems to be displayed fine in ns7, opera and ie6. i am really happy with the results.

Thank you!

Birdman




msg:1221426
 3:11 pm on Apr 17, 2003 (gmt 0)

>>My question is, if it is acceptable to use divs within tables and does it have any disatvanatges?

Yes(acceptable) and no(no disadvanages).

WibbleWobble




msg:1221427
 3:12 pm on Apr 17, 2003 (gmt 0)

Why are you encasing divs within tables? I don't see the need, unless you're after code bloat for no reason. Apply the styles to the table cells, or other elements; or go tableless - don't do both, its pointless.

organic21




msg:1221428
 4:24 pm on Apr 17, 2003 (gmt 0)

tables do not provide optimal readability when using screenreaders. thats the only reason why want to use divs instead of tables with css styles, encasing the divs within tables will help me to decrease the number of tables.

Thanks birdman. thats all i wanted to know

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved