...

View Full Version : Table Column Width Problem



Badman3k
03-13-2005, 04:57 PM
I have a bit of a problem with trying to make my table dispaly properly.

I want to have a 5 column table with 4 out of the 5 being fixed widths, but the other needs to be variable.

----------------------------------------------------------------------------
|<63px>|<----------variable--------->|<63px>|<--67px-->|<----155px---->|
----------------------------------------------------------------------------

I've tried many different methods and even tried using the source from the forum (as that's a very similar scenario) but nothing seems to want to work! :(

Here's the source of the table I'm using:


<table width="100%">
<tr>
<td width="63">a</td>
<td>b</td>
<td width="63">c</td>
<td width="67">d</td>
<td width="155">e</td>
</tr>
</table>


As you can see from the code, i want to be able to have the whole table scale when the browser res changes, but I can't get it to work on any res at all.

I'm sure there's a really simple solution to this but I'm just not seeing it at all. Any help would be greatly appreciated, cause it's starting to really get to me lol:D
Thanks in advance,

hemebond
03-13-2005, 08:18 PM
Have you tried specifying a unit like you did in your ASCII diagram?

harbingerOTV
03-13-2005, 08:54 PM
hmmm...

works for me:

http://home.earthlink.net/~harbingerofthevoid/testing/badman.html

Badman3k
03-13-2005, 11:27 PM
:confused: I don't get this at all. I've been doing that for most of the night and it doesn't work. The only thing it could possibly be is the fact that it's contained within a DIV, but even this doesn't make sense. I can't see how having it contained within a div is going to effect the way that the table works.

Anyone have any ideas? I'm at a complete loss. :(

harbingerOTV
03-14-2005, 01:56 AM
Can you post up the code for it?

If the Div that has the table in it has a fixed width than the table will not collapse.

Badman3k
03-14-2005, 07:36 AM
Sure can do. Here's the code with the div included:


<div style="width: 100%; height: auto; border-left: 1px solid #93B6EF; border-right: 1px solid #93B6EF; border-bottom: 0px none #93B6EF; border-top: 1px solid #93B6EF; margin-top: 20px; padding: 0px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="overview_heading">
<th width="63">&nbsp;&nbsp;</th>
<th>{L_FORUM}</th>
<th width="63">&nbsp;{L_TOPICS}&nbsp;</th>
<th width="69">&nbsp;{L_POSTS}&nbsp;</th>
<th width="155">&nbsp;{L_LASTPOST}&nbsp;</th>
</tr>
</table>


There are obviously other rows after this, but if i can get one to work I should be able to get them all to work, well that's the how i feel it should lol:D

Thanks,

harbingerOTV
03-14-2005, 12:50 PM
Well, that works as well. If you just make a demo page with just that code in it you'll see what I mean. So there is probally something else either above or below it that has a fixed width that stops this particular table from collapsing.

Do you have a page up so the whole code can be seen?

Badman3k
03-14-2005, 01:11 PM
Thanks for helping, I managed to solve the problem. Not exactly sure what I did to make it work, but I messed around with the containing DIVs and it just started working all of a sudden lol :D If I ever discover what it was that I did to make it work I'll let you know lol


Thanks again,



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum