HTML table syntax

Posted on 2002-07-05
Last Modified: 2010-04-09
I have created a table in HTML that has about 10 fields.
Some of the fields contain values that contain "spaces". When
the table is displayed on the browser, the contents of those
fields (that contain values with spaces) are often shown in
separate lines on the browser, as if the spaces
are newlines.
Is there any HTML table syntax that can help show the content
of a big field in a single line on the browser?
Example: One field content "This_is_the_first_line This_is_the_second_line"
I wish to show this on a single line on the HTML page.

Question by:tooki
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
LVL 18

Accepted Solution

bruno earned 50 total points
ID: 7132590
put this in the TD...

<td style="white-space: nowrap;">

and use this for your spaces..


(stands for non breaking space)

LVL 19

Expert Comment

ID: 7133281
Post your code. Bruno's answer might work, or it might not. Depends on everything else in the table.
LVL 12

Expert Comment

by:Wouter Boevink
ID: 7140096
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

LVL 51

Expert Comment

ID: 7140152
KISS -keep it small and simple ;-)
LVL 18

Expert Comment

ID: 7140765

your solution is just an older version of what I posted...
LVL 12

Expert Comment

by:Wouter Boevink
ID: 7140955
So it works in most (and older) browsers.
LVL 19

Expert Comment

ID: 7141302
If you use nbsp, you don't even need to use the nowrap -- the browser won't break lines without spaces. That will work for EVERYTHING, but it's going to make your table be really huge and hard to read. You could also make all your text a graphic, which would look exactly how you want, but make it even HARDER to read. ;-)

How many rows does this have? If you have more columns than rows, you might want to pivot the table -- reverse how you have it.

Expert Comment

ID: 7141369

this is not standard html but it works in IE and Netscrap

IF... you want it to break somewhere you can add a <wbr> tag where you want the break to occur...


so if there is room it will not wrap if there is not room it will wrap where you specify with the <wbr> tag...


Author Comment

ID: 7151633
Thanks a lot!! It worked perfectly.
LVL 18

Expert Comment

ID: 7152740
Glad I could help!  Thanks for the A.  :-)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question