Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


HTML table syntax

Posted on 2002-07-05
Medium Priority
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 200 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
Independent Software Vendors: 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!

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

618 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