473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Preventing Wrapping In Text

CJM
I have an application which returns telephone numbers along with other
information. I leave the table that holds this information alone to resize
itself, but in many cases it causes telephone numbers to wrap.

I'd like these numbers to remain on one line, so either the column should
widen or they should be moved to a new line in the cell. However, previous
attempts to enforce this have failed - clearly I'm not pressing the right
buttons.

I just want to be able to enclose the numbers in a <SPAN> and style it such
that that span either wont wrap or has a minimum width. Needless to say, I'd
like as simple a cross-browser solution as possible.

Any ideas?

Thanks in advance

Chris

--
cj*******@REMOVEMEyahoo.co.uk
[remove the obvious bits]
Jan 11 '06 #1
8 2315
"CJM" <cj******@REMOVEMEyahoo.co.uk> wrote:
I have an application which returns telephone numbers along with other
information. I leave the table that holds this information alone to resize
itself, but in many cases it causes telephone numbers to wrap.

I'd like these numbers to remain on one line, so either the column should
widen or they should be moved to a new line in the cell. However, previous
attempts to enforce this have failed - clearly I'm not pressing the right
buttons.


http://www.w3.org/TR/CSS21/text.html#white-space-prop

--
Spartanicus
Jan 11 '06 #2
"CJM" <cj******@REMOVEMEyahoo.co.uk> wrote:
I have an application which returns telephone numbers along with other
information. I leave the table that holds this information alone to
resize itself, but in many cases it causes telephone numbers to wrap.
There are several ways to achieve that. The CSS method is to set
white-space: nowrap for those <td> elements that contain a phone number.
Achieving this is a bit clumsy, but it's doable. In fact, it is sufficient to
prevent line breaks in the _longest_ cell content, if you can identify the
longest one. Alternatively, you could use HTML markup: <td nowrap>.
Or you could write the number using no-break spaces, perhaps presented as
entity references, e.g. <td>+358&nbsp;9&nbsp;40&nbsp;844&nbsp;8617</td>.
I just want to be able to enclose the numbers in a <SPAN> and style it
such that that span either wont wrap or has a minimum width.


Why would you use <SPAN> if the number occupies a table cell, which is itself
a styleable element.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jan 11 '06 #3
On 2006-01-11, CJM <cj******@REMOVEMEyahoo.co.uk> wrote:
I have an application which returns telephone numbers along with other
information. I leave the table that holds this information alone to resize
itself, but in many cases it causes telephone numbers to wrap.
have your application replace any spaces in the telephoine numbers with the
non-breaking space &nbsp; leaving regular spaces between the telephone
numbers only.
I just want to be able to enclose the numbers in a <SPAN> and style it such
that that span either wont wrap or has a minimum width. Needless to say, I'd
like as simple a cross-browser solution as possible.

Any ideas?


there's an attribute you can use for that but I forget what it is.

--

Bye.
Jasen
Jan 12 '06 #4
Jasen Betts wrote:
On 2006-01-11, CJM <cj******@REMOVEMEyahoo.co.uk> wrote:
I have an application which returns telephone numbers along with other
information. I leave the table that holds this information alone to resize
itself, but in many cases it causes telephone numbers to wrap.


have your application replace any spaces in the telephoine numbers with the
non-breaking space &nbsp; leaving regular spaces between the telephone
numbers only.
I just want to be able to enclose the numbers in a <SPAN> and style it such
that that span either wont wrap or has a minimum width. Needless to say, I'd
like as simple a cross-browser solution as possible.

Any ideas?


there's an attribute you can use for that but I forget what it is.


white-space: nowrap

Jan 12 '06 #5
I know it is oldfashioned and not CSS. But I thought that at least it
should be mentioned: <NOBR>

Jan 13 '06 #6
condor wrote:
I know it is oldfashioned and not CSS. But I thought that at least it
should be mentioned: <NOBR>

While most (all?) browsers support <nobr>, it is not a valid HTML element.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jan 13 '06 #7
CJM

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.4.246 ...

Why would you use <SPAN> if the number occupies a table cell, which is
itself
a styleable element.


Because I was busy clutching at straws when previous solutions failed! lol
Jan 16 '06 #8
CJM
All,

Thanks for your responses, and apologies for the delay in feedback.

I followed Spartanicus's prompt response and used white-space:nowrap in
appropriate table cells, and it worked a treat.

Cheers

Chris
Jan 16 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Buddy | last post by:
Hello, Does anyone know how to stop labels from wrapping text. If the text is to long for the label then I want it to hide the text just like out the TextBox control works. Thanks,
1
by: mg | last post by:
I set the width of a WebForm Label but do not get line wrapping (see below). What can I do to get line wrapping WebForm1.asp <asp:Labe id="Label1" style="Z-INDEX: 101; LEFT: 40px; POSITION:...
4
by: rodchar | last post by:
Hey all, I have a datagrid that auto-generate the columns. When I run the app some of the column values are wrapping. How do I prevent the values from wrapping? Do I have to use template...
9
by: Siv | last post by:
Hi, I am trying to find a wrapping routine for text and not having much luck. The reason I need one is that I am producing a report where the text that was stored in the database was written into...
6
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre {...
6
by: TheTamdino | last post by:
I have experienced this issue in both IE and in Firefox, but usually not the same page at the same time. I'll have text that begins and ends with the paragraph tag <p>. This tag is suppose to...
6
by: Greg Esres | last post by:
I have some text lines to print that are much longer than the width of the paper, maybe as much as 6 times. For a given page, I'd like everything that doesn't fit to print on a second page, and...
2
by: davidcm | last post by:
Last week, I found some code on-line that allows me to send email via SMTP from my VB 6.0 application. I had to add the Winsock control to the project and add the code that performs the SendData...
1
by: Leviathan via AccessMonster.com | last post by:
I'm trying to export an Access table to a pipe-delimited text file (with no text qualifier) and it keeps wrapping the text for one of the tables. None of the fields are particularly long, so I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.