autowarping text in a table

liunx

Guest
how do I autowarp text in a table? or shall I use <div> ? and if so, how?<!--content-->it autowraps if the text is not all one line.<!--content-->yes I know, but the text is only one line..<!--content-->If you style a div with a width it will wrap at a space:<br />
<br />
<div style="width:100px"><br />
this is s line of text that will wrap within the div if it is too wide to fit in the defined width<br />
</div><br />
<br />
For a table cell you need to add a stlye to the table:<br />
<br />
<table style="table-layout:fixed"> and then give the cell a width: <td width="100px"><br />
<br />
If the line is a long unbroken string of characters with no spaces is will not wrap so you manage it with overflow:<br />
<br />
<div style="width:100px;overflow:hidden"><br />
to truncate the line or<br />
<div style="width:100px;overflow:auto"><br />
to add scrollbars.<br />
<br />
You can add the overflow style to a cell but it is much less reliable than a div and much less support, so you are better to put the text in a div inside the cell and apply to overflow to the div<!--content-->Originally posted by pooof <br />
yes I know, but the text is only one line.. <br />
one line with no spaces?<!--content-->yes, exactly, _no_ spaces, is it possible?<!--content-->or shall I say, is there a easy way to do it?<!--content-->not without serverside language. then you can see how many characters you wan tthen split. but that is a waste of time.<!--content-->
 
Back
Top