Forum Moderators: open

Message Too Old, No Replies

How do I fix a <TD> to a set width.?

         

midi25

10:46 am on Jan 10, 2005 (gmt 0)

10+ Year Member



Hi how do I set a <TD> cell to a fixed width. The problem I get when I create 2 <TD> cells is that they shift.

I want to set one <TD> at 25% fixed. So I cant insert text and then have the text wrap and not have it shift over etc. And the other <TD> at 75%.

How can I do this.

Eg

Thanks

Sanenet

10:49 am on Jan 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<table width="100%">
<tr>
<td width="25%">table 1 content</td>
<td width="75%">table 1 content</td>
</tr>
</table>

midi25

11:22 am on Jan 10, 2005 (gmt 0)

10+ Year Member



I want it to wrap.

eg If i dot his its just scrolls

<html>
<body>
<table width="100%">
<tr>
<td

width="25%">lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

</td>
<td width="75%">table 1

contentllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

</td>
</tr>
</table>

</body>
</html>

BonRouge

2:06 pm on Jan 10, 2005 (gmt 0)

10+ Year Member



css
table {
table-layout:fixed
width:400px;
}
td#one {
width:25%;
border:1px solid red;
}
td#two {
width:75%;
border:1px solid blue;
}

html

<table>
<tr>
<td id="one">one</td>
<td id="two">two</td>
</tr>
</table>