|
-
Feb 7th, 2010, 08:46 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] table, column width
i'm making a site, i tried using divs but what i tried didn't seem possible using divs, now i try it again using table
what i need is first column to be 170px, the next to auto size and the 3rd to be 170px again, now the problem is in internet explorer to make it have this size, because in ie all 3 columns get bigger, i can't really find out how to do this, any suggestions?
Last edited by Justa Lol; Feb 7th, 2010 at 03:42 PM.
-
Feb 7th, 2010, 11:30 AM
#2
Thread Starter
Fanatic Member
Re: table, column width
since no-one has replied yet, i guess i need to add a bit more information...
Code:
<table cellpadding="0" cellspacing="0" border="0" frameborder="0" width="100%">
<tr>
<td style="min-width:170px" valign="top">left</td>
<td rowspan="2" style="min-width:660px;" valign="top">center</td>
<td style="min-width:170px" valign="top">right</td>
</tr>
<td style="min-width:170px" valign="top">left</td>
<td style="min-width:170px" valign="top">right</td>
</table>
it does what it should, just not in ie...
edit: i forgot that the left and right should be min and max at 170px... so thats just max-width?
Last edited by Justa Lol; Feb 7th, 2010 at 11:47 AM.
-
Feb 7th, 2010, 11:45 AM
#3
Re: table, column width
"min-width" means "this element needs to be a minimum of 170px, but it can also be larger." If you don't want your element to exceed 170px, use "width."
Also, <td>s should never be directly within the <table> element; for syntactical correctness, wrap those last two in <tr></tr>.
-
Feb 7th, 2010, 11:48 AM
#4
Thread Starter
Fanatic Member
Re: table, column width
if i put width="170px" then it still gets bigger or smaller depends on the screen size
edit: updated code:
Code:
<table cellpadding="0" cellspacing="0" border="0" frameborder="0" width="100%">
<tr>
<td style="width:170px;" valign="top">left</td>
<td rowspan="2" style="min-width:660px;" valign="top">center</td>
<td style="width:170px;" valign="top">right</td>
</tr>
<td style="width:170px;" valign="top">left</td>
<td style="width:170px;" valign="top">right</td>
</table>
still it doesn't respect the min-width:660px;
edit: i need the table to be no smaller then 1000px in width...
Last edited by Justa Lol; Feb 7th, 2010 at 11:54 AM.
-
Feb 7th, 2010, 01:40 PM
#5
Re: table, column width
you still didn't put the two last <td>s within a <tr>; this may produce strange results because a browser may not know how to handle it. if your left and right columns are both 170px, then the center td doesn't need a width or min-width property. apply a min-width to the table itself of 1000px if that's the smallest size you want.
-
Feb 7th, 2010, 01:53 PM
#6
Thread Starter
Fanatic Member
Re: table, column width
oh i didn't see that <tr>..
the side columns should be no more or no less then 170px, which seems to be working now, but still on internet explorer it doesn't respect the min-width of the center...
Code:
<table cellpadding="0" cellspacing="0" border="0" frameborder="0" style="min-width:1000px;width:100%;">
<tr>
<td style="width:170px;min-width:170px;max-width:170px;" valign="top">left</td>
<td rowspan="2" style="min-width:660px;" valign="top">center</td>
<td style="width:170px;min-width:170px;max-width:170px;" valign="top">right</td>
</tr>
<tr>
<td style="width:170px;min-width:170px;max-width:170px;" valign="top">left</td>
<td style="width:170px;min-width:170px;max-width:170px;" valign="top">right</td>
</tr>
</table>
-
Feb 7th, 2010, 02:53 PM
#7
Thread Starter
Fanatic Member
-
Feb 7th, 2010, 02:57 PM
#8
Re: table, column width
What kind of doctype do you have on your page (if any)? You'll need a strict one.
The max-widths you've added are completely unnecessary.
i got this solved by using divs(?strange?)
Ugh, I thought you said you're using a table because divs won't work for what you want. Have you forgotten your own motivations?
-
Feb 7th, 2010, 02:58 PM
#9
Thread Starter
Fanatic Member
Re: [RESOLVED] table, column width
it doesn't matter i got it working using divs... i put a link in the post..
edit: i figured it didn't work.. now the height of it won't work...
this project really pisses me off, when i try table, the width won't work as i want it, and when i try divs, the height won't.
how it want it to be: theres a header thats 150px in height, a menu thats 80px in height, then there comes the content which is 3 side bars left(max and min width 170px, height will resize with the document), center(min width 660px and no max width as it should resize as the browsers width is, height will resize with the document), right (max and min width 170px, height will resize with the document)
and then footer which is 80px
the doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
edit: i put a div around the table with the style="min-width:1000px;" and the table would just have a width of 100% and somehow it works now i'm happy again, finally after trying this for 2 days...
Last edited by Justa Lol; Feb 7th, 2010 at 05:05 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|