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
Solved

HTML table syntax

Posted on 2002-07-05
10
172 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 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