Monday, September 12, 2005

Word breaking in IE

From this page comes the following:
For table cells, nowrap works

In special cases, when the data is in a table cell and it is adequate to prevent all line breaks in it, you can use the nowrap attribute for the td or th element. That attribute is "deprecated", but it is still valid. Note, however, that browsers seem to ignore it, if a fixed width (in pixels) is set for the cell so that the content doesn't fit into that without wrapping.

The nobr markup
It seems that in general the only cure is to use the nonstandard, Netscape-invented (!) nobr markup. It has never been adequately defined, and browsers generally treat it in a command-like fashion: is taken as "disallow line breaks from now on" and says "line breaks allowed from now on". But it is safest to use it as text-level markup only. This should suffice, since we normally would use nobr for short pieces of text only, as in vis-a-vis or -a.