how do I do a two column table in css?
Hi all,
I'm trying to make a two column table, where the left column stretches with the browser, while the right column always stays at a fixed width. Content will go in the left column, while the right column is for links.
How do I code my css to achieve this? I've got the html part:
<table>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
thanks guys
demonhale posted this at 05:43 — 24th January 2006.
He has: 3,278 posts
Joined: May 2005
You can do a whole css two column layout without using tables, visit A List Apart... or search ALA 2 column css in google
Anita.Bonghit posted this at 06:57 — 24th January 2006.
They have: 43 posts
Joined: Sep 2005
Cool thanks.
Busy posted this at 09:07 — 24th January 2006.
He has: 6,151 posts
Joined: May 2001
Or you can add CSS to the table
content
navigation
etc, is valid XHTML 1.0 Strict
technostick posted this at 19:36 — 30th January 2006.
They have: 27 posts
Joined: Sep 2005
While that does work, it is generally not a good idea to use tables unless absolutely necessary.
Megan posted this at 15:37 — 4th February 2006.
She has: 11,421 posts
Joined: Jun 1999
Try this:
#container {width: 100%;}
#navigation {}
#links {width: 150px;}
That's it (I think - haven't worked with tables in a long time). The links column should stay at 150 pixels and the content area will stretch to fill the space. By using external styles you'll be able to add whatever other CSS you want to each of those areas.
<table id="container">
<tr>
<td id="content">
</td>
<td id="links">
</td>
</tr>
</table>
Megan
Connect with us on Facebook!
Megan posted this at 15:38 — 4th February 2006.
She has: 11,421 posts
Joined: Jun 1999
In case anyone is wondering I just split out all the debate about CSS vs. tables and put it into a new thread. You can find it here:
http://www.webmaster-forums.net/editpost.php?do=editpost&p=192178
Megan
Connect with us on Facebook!
DaveyBoy posted this at 15:57 — 4th February 2006.
They have: 453 posts
Joined: Feb 2003
it won't let me view that thread for some reason
DaveyBoy, you do not have permission to access this page. This could be due to one of several reasons:
1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
demonhale posted this at 15:59 — 4th February 2006.
He has: 3,278 posts
Joined: May 2005
hmmm only moderators can argue with the whole thing, why not append it to my old thread css and table combinations...
Renegade posted this at 06:06 — 5th February 2006.
He has: 3,022 posts
Joined: Oct 2002
Seems like Megan linked to the "edit post." Here is the actual thread:
http://www.webmaster-forums.net/showthread.php?t=32919
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.