Solved

HTML table syntax

Posted on 2002-07-05
10
159 Views
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.

Thanks,
tooki
0
Comment
Question by:tooki
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 18

Accepted Solution

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


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

and use this for your spaces..


&nbsp;

(stands for non breaking space)



BRUNO
0
 
LVL 19

Expert Comment

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

Expert Comment

by:Wouter Boevink
ID: 7140096
<TD NOWRAP>
0
 
LVL 51

Expert Comment

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

Expert Comment

by:bruno
ID: 7140765
wboevink,

your solution is just an older version of what I posted...
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

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

Expert Comment

by:webwoman
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.
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 7141369
<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
 

Author Comment

by:tooki
ID: 7151633
Thanks a lot!! It worked perfectly.
-tooki
0
 
LVL 18

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 is …
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 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 position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now