Forum Moderators: open

Message Too Old, No Replies

<nobr> is deprecated, no?

I want to avoid line-split of phone numbers

         

albo

6:12 pm on Apr 20, 2005 (gmt 0)

10+ Year Member



I think there is not a non-discretionary hyphen in the character set. It looks like a hyphenated phone number is an "invitation" for xhtml (especially in a td) to line-split a phone number to squish things up unless an explicit width is set for the td column (not tidy). Is there a better way, perhaps a css class?

MatthewHSE

6:21 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The CSS property for this is:

white-space: nowrap;

It works quite well on most browsers (IE 5.5 and up I think, plus every version of Gecko browsers for the past few years). Older browsers just get the line break.

2by4

6:28 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Konqueror/Safari has issues with that method, as I just learned yesterday when checking a new site. Oddly, it works sometimes the way it's supposed to, other times the behavior got erratic, for example it gave nowrap to the parent of the tag with the nowrap in one case, in another case not. Ah, for the day when real CSS cross browser support exists. Won't be in my lifetime I think.

albo

8:08 pm on Apr 20, 2005 (gmt 0)

10+ Year Member



Okay, white-space: nowrap works! Thanks. I guess I may have to shrink font-size. The table includes email addresses and in mozilla browsers on print-preview (haven't tried actual print) the email <td> overflows the border... but that's a different issue. Again, thanks. I'm testing in IE, FoxFire, Netscape, Opera, and will test on iPAQ's version of IE to get this page altogether.

Reid

6:30 am on Apr 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use non-breaking space for words I don't want split
Isn't that what it was intended for anyway?

albo

7:34 pm on Apr 21, 2005 (gmt 0)

10+ Year Member



What is breaking across the line is the hyphen e.g. phone number 123-4567 goes to 123-
4567
Therefore the nowrap works to avoid this on every browser (release) I have checked so far (I haven't have occasion to go back to older releases, and I hope not too many viewers haven't either...)