Click to See Complete Forum and Search --> : Table width


Superfly1611
06-14-2005, 06:03 PM
In a web page i'm creating I have a table. I need this table to have a width that will not change regardless of the content size.
Below is the html for my table:


<table class="tableClass">
<tr>
<td colspan="2">Title</td>
</tr>
<tr>
<td rowspan="5"><img src="pic" height="240px" width="320px" /></td>
<td>fld1: value</td>
</tr>
<tr>
<td>fld2: value</td>
</tr>
<tr>
<td>fld3: value</td>
</tr>
<tr>
<td>fld4: value</td>
</tr>
<tr>
<td>fld5: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</td>
</tr>
</table>


.tableClass
{
width:475;
}

As you can see one table cell has a string value in it that has a considerable length. This value extends the width of the table beyond the width defined by the table CSS class.

I want the table to not exceed the defined width, instead i want the table cell to wrap the value onto the next line, is this possible?

CSS or HTML sollutions are equally acceptable

Many Thanks

Fang
06-15-2005, 07:08 AM
You will have to 'break' the long string with several zero width spaces &#8203; and use a font-family that supports this character.

btw always add units to lengths in css: .tableClass {width:475px;}