• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

HTML table syntax

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.

Thanks,
tooki
0
tooki
Asked:
tooki
  • 3
  • 2
  • 2
  • +3
1 Solution
 
brunoCommented:
put this in the TD...


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

and use this for your spaces..


&nbsp;

(stands for non breaking space)



BRUNO
0
 
webwomanCommented:
Post your code. Bruno's answer might work, or it might not. Depends on everything else in the table.
0
 
Wouter BoevinkCommented:
<TD NOWRAP>
0
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!

 
ahoffmannCommented:
KISS -keep it small and simple ;-)
0
 
brunoCommented:
wboevink,

your solution is just an older version of what I posted...
0
 
Wouter BoevinkCommented:
So it works in most (and older) browsers.
0
 
webwomanCommented:
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.
0
 
TenTonJimCommented:
<nobr>somereallylonglineoftextthatisaproblem</nobr>

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...

<nobr>somereallylonglineof<wbr>textthatisaproblem</nobr>

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

JimS.
0
 
tookiAuthor Commented:
Thanks a lot!! It worked perfectly.
-tooki
0
 
brunoCommented:
Glad I could help!  Thanks for the A.  :-)
0

Featured Post

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!

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now