473,396 Members | 1,935 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.

Prevent word wrap in a table cell

Hi, all! I have a question.

I am designing a listing similar to a phone book in HTML. Each listing has
periods following it, but they must extend to the end of the table cell, and
not wrap.

Is there any way to prevent the text from 1) wrapping within the table cell
and 2) causing the table cell to expand? In other words, the filler periods
must flow past the right boundary of the cell (but not be seen). Similar to:

[Ben's Car Shop.......................] [555-5555]

Any information is appreciated. Thanks!

--
Dave
www.grundage.com
Mar 14 '06 #1
2 64893
On Tue, 14 Mar 2006 17:39:41 -0600, "Yeah" <ye**@positive.net> wrote:
Is there any way to prevent the text from 1) wrapping within the table cell


Within the <td> itself:
<td style="white-space: nowrap;">foo</td>

In a stylesheet, something like:

table td {white-space: nowrap;}

The above would apply to all <td>s.

Ian
--
http://sundry.ws/
Mar 15 '06 #2
"Yeah" <ye**@positive.net> wrote:
I am designing a listing similar to a phone book in HTML. Each listing
has periods following it, but they must extend to the end of the table
cell, and not wrap.
The big problem here is how to implement the periods. Several approaches have
been suggested on such matters in c.i.w.a.stylesheets. Whether the whole idea
is feasible on the WWW is debatable. In any case, it would be more like a
styling issue than HTML. You don't really want to have masses of periods as
_content_ of your pages.
Is there any way to prevent the text from 1) wrapping within the table
cell
In HTML, several ways:

a) <td>foo&nbsp;bar</td> (or with &nbsp; replaced by the no-break space
character)

b) <td nowrap>foo bar</td> (suitable only if _all_ line breaks inside a cell
are to be suppressed)

c) <td><nobr>foo bar</nobr></td> (nonstandard but widely supported)

d) <td><pre>foo bar</pre></td> (has other effects as well, somewhat nastily)

In CSS, use white-space: nowrap.
and 2) causing the table cell to expand?
In HTML, no. The CSS side of the matter belongs to our sister group. It's not
trivial, but you could use table-layout: fixed for the table, set the cell
width, and set overflow: hidden for the cell. This would imply that essential
information will be made invisible to some users unless you are very careful.
You didn't think of setting the width in pixels, did you?
In other words, the filler
periods must flow past the right boundary of the cell (but not be seen).
Similar to:

[Ben's Car Shop.......................] [555-5555]


Is this really about telephone numbers, or what?

The recommended (by ITU) notation for telephone numbers does not use hyphens
but spaces. You could use the no-break space character, which works well,
whereas the nonbreaking hyphen is poorly supported.

In the WWW context, phone numbers should be expressed in the international
notation (starting with "+"), unless limited to a single country or other
numbering area and clearly indicated as such.

(Telephone numbers could be made links, using the tel: scheme. This might be
nice in the future when (or if) browsers support tel: URLs and let the user
just click on a number to make a phone call or send a text message. Then
again, if it became common, spammers would try to make use of it.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Mar 15 '06 #3

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

Similar topics

2
by: Paul E Collins | last post by:
I need to 'clip' text in a table cell instead of wrapping it, such that (i) the cell keeps its specified fixed width and (ii) any text that overflows the cell should be 'clipped' (hidden or...
10
by: Jeff B. | last post by:
Has anyone come across a decent algorithm for implementing word wrap features in .net printing? I have a small component that uses basic printing techniques (i.e. e.Graphics.DrawString in a...
10
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
5
by: momo | last post by:
say i have the following table: <table width="500"> <tr> <td width="250">this is the text im concerned with</td> <td></td> </tr> </table> i need the width of the columns to STAY at 250 and...
7
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is...
2
by: amitp | last post by:
hi i'm using MS Word2003 for my VB application which is a report. The word documents contains tables and the cells inside the table contain some fields. My application replaces the field values with...
1
by: bussasrinivas | last post by:
How to wrap up text shown with a table cell after a certain length intervals ? -------------------------------------------------------------------------------- I have a requirement to wrap a...
3
by: visweswaran2830 | last post by:
I have html table.I am creating table rows & cells at run time using aspx.vb. Now I want to set word wrap in html table cell. How do I set this?
0
jimleon
by: jimleon | last post by:
I need to set the last character in a word 2007 Table cell string superscript property in VB. I have seen examples where the .Character(start char, number of chars) method is employed but that...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.