PDA

View Full Version : two columns? pure style or table it?



justsomemadison
Sep 6th, 2007, 03:21 AM
hi! i'm currently building a small mock up site and am trying to write in two pure css columns. i have included the code below, which is perfectly functional in the entire layout until i get the columns, which i'm trying to create two identical width/height columns. is this possible in css or should i just hit up tables?

the link below is the current image of layout, with the bad floating text. i've highlighted the placement for the columns. thanks for the help... i really appreciate it.

http://www.originindigo.com/temp/desktop_snap.gif


.typel {
margin:10px;
padding:10px;
float:left;
width:50%;
text-align:left;
}

.typer {
margin:10px;
padding:10px;
width:50%;
float:right;
text-align:left;
}

Len Whistler
Sep 6th, 2007, 07:03 AM
I would go with divisions and CSS, forget the tables. I'm in the process of switching my image gallery over from tables to divisions.

_Aerospace_Eng_
Sep 6th, 2007, 07:24 AM
Its possible except padding and margin count for the horizontal space that each div takes up. Currently you have this


.typel {
margin:10px;
padding:10px;
float:left;
width:50%;
text-align:left;
}

.typer {
margin:10px;
padding:10px;
width:50%;
float:right;
text-align:left;
}
Each div is taking up 50% of their parent element + 40px of horizontal space because of the margins and padding. IE6 is doubling your margin so you need to add display:inline; to fix this.

What is the width of the parent element of the columns? It might be better to just set the width of your columns in pixels.

And NO tables are not for page layout. Read the link in my sig titled "Why Tables for Layout is Stupid?".