table widths

liunx

Guest
when displaying text in a table cell with a fixed width, the text automatically wraps... but when there are no spaces in the text, the cell width increases until there is. Without writing a function, is there a way to keep the cell width fixed and wrap the text?<!--content-->Browsers require some kind of space to tell them where it is "ok" to break a line. If your text has no spaces in it, the behaviour is "no line break". W3C recommendations include a zero-width space that indicates a separation point - &#x200B. See <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/struct/text.html#h-9.1">http://www.w3.org/TR/html4/struct/text.html#h-9.1</a><!-- m --><!--content-->gil davis,<br />
As a diehard NS user, you might be informed that that only works in IE. I don't have NS 7<!--content-->You can also use a <wbr> tag where there is allowed to be a line break, though I doubt it belongs to any standard.<!--content-->Originally posted by Count_Rugen <br />
Without writing a function, is there a way to keep the cell width fixed and wrap the text? <br />
<br />
No, a table is SPECIFICALLY designed to IGNORE size constraints on it if the content in it does not fit.<br />
<br />
That is one of the many reasons you should not abuse <table> for general layout.<br />
<br />
Use CSS and eg divs and your specified sizes will not be ignored.<!--content-->
 
Back
Top