By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

force column width in a table?

P: n/a
Hi,

I want to ensure one column in a table is always the same number of pixels
wide no matter what the screen resolution is set to on the visitors PC - the
other two columns can wrap away top their hearts content.

How do I do this please? The code below doesn't do it.

<table border="1" width="100%">
<tr>
<td width="180" valign="top">&nbsp;</td>
<td width="*" valign="top">&nbsp;</td>
<td width="*" valign="top">&nbsp</td>
</tr>
</table>
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
David wrote on 04 jul 2003 in comp.lang.javascript:
Hi,

I want to ensure one column in a table is always the same number of
pixels wide no matter what the screen resolution is set to on the
visitors PC - the other two columns can wrap away top their hearts
content.

How do I do this please? The code below doesn't do it.

<table border="1" width="100%">
<tr>
<td width="180" valign="top">&nbsp;</td>
<td width="*" valign="top">&nbsp;</td>
<td width="*" valign="top">&nbsp</td>
</tr>
</table>


A bit strange but it works (IE6):

<table width="100%" border=1>
<tr><td width="105px">
<div style="width:105px;overflow:hidden;">
qwertyqwertyqwertyqwertyqwertyqwertyqwerty
</div>
</td><td>
xxxxxxxxxxxxxx
</td><tr/></table>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

P: n/a
A bit strange but it works (IE6):

<table width="100%" border=1>
<tr><td width="105px">
<div style="width:105px;overflow:hidden;">
qwertyqwertyqwertyqwertyqwertyqwertyqwerty
</div>
</td><td>
xxxxxxxxxxxxxx
</td><tr/></table>

Thanks - it's a bit of a shame as the IE page works fine, the page I'm
working on is the one optimised for Netscape :(

I think I'll have a rethink.

David
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.