Testing some methods of preventing line breaks
This page is an appendix to the page
Word division in IE
and other notes on the nobr
markup
and on suggesting possible “word” breaks.
Preventing wrapping at a space in a cell
All tables have their cell width set to 3em.
Since table layout is defaulted to automatic, non-wrappable cell
content will cause the cell width to expand.
Small cell contents, for comparison
Cell contents that fits when word-wrapped
No-break space used to prevent wrapping
nobr
markup used
nowrap
attribute used
CSS code white-space: nowrap
used on the cell element
CSS code white-space: nowrap
used on an element inside the cell element
Preventing wrapping at “?” in a cell
Small cell contents, for comparison
Cell contents that fits if wrapped after “?”
Word joiner (WJ) character used to prevent wrapping
Zero-width no-break space (ZWNBSP) character used
nobr
markup used
nowrap
attribute used
CSS code white-space: nowrap
used on the cell element
CSS code white-space: nowrap
used on an element inside the cell element
Preventing wrapping at a space in a block
This is different from the previous
tests in the sense that the text is not within a table cell
but within a block, specifically a div
All.
That element has its width set to 3em.
Small contents, for comparison
x
Block contents that fits when word-wrapped
9999 ABCD
No-break space used to prevent wrapping
9999 ABCD
nobr
markup used
9999 ABCD
CSS code white-space: nowrap
used on the block element
9999 ABCD