For the experts: comma separated values won't wrap?

D

DrLovely

If you copy and paste the html below to a file with an .htm extension
and open it in IE 6.0, you'll notice that the text with the word
"Nokia" in it DOES NOT WRAP to the size of the table. It seems to
think this is a long word or something...

HOW can I get this text to wrap, even if I have to use some code to
change the string somehow? Maybe a style class or something would
wrap it?

I need this to wrap!

Any response would be highly regarded!


<table cellspacing="0" cellpadding="0" border="1" width="50">
<tr>
<td>
<A class=ltgray
href="?qT=3&amp;m=11&amp;ct=35&amp;cpg=1&amp;sz=l&amp;pid=9271&amp;showDetail=true">
&nbsp;
</a>picture here</td>
<td rowspan="2" class="ltgray">
<b>
<A
href="?qT=3&amp;m=11&amp;ct=35&amp;cpg=1&amp;sz=l&amp;pid=9271&amp;showDetail=true">
Nokia 252,282,5/6/7100,8200,8800 AC
</a>
<b>
</td>
</tr>
<tr>
<td align="middle">
links here
</td>
</tr>
</table>
 
A

Adrienne

Gazing into my crystal ball I observed DrLovely@. writing in
If you copy and paste the html below to a file with an .htm extension
and open it in IE 6.0, you'll notice that the text with the word
"Nokia" in it DOES NOT WRAP to the size of the table. It seems to
think this is a long word or something...

HOW can I get this text to wrap, even if I have to use some code to
change the string somehow? Maybe a style class or something would
wrap it?


Nokia 252,282,5/6/7100,8200,8800 AC

Put spaces after the commas:
Nokia 252, 282, 5/6/7100, 8200, 8800 AC
 
L

Lauri Raittila

in said:
If you copy and paste the html below to a file with an .htm extension
and open it in IE 6.0, you'll notice that the text with the word
"Nokia" in it DOES NOT WRAP to the size of the table. It seems to
think this is a long word or something...

HOW can I get this text to wrap, even if I have to use some code to
change the string somehow? Maybe a style class or something would
wrap it?

I need this to wrap!

http://www.cs.tut.fi/~jkorpela/html/nobr.html

[snipped ugly and unnecessary html snipped.]
 
R

Roy Schestowitz

Adrienne said:
Gazing into my crystal ball I observed DrLovely@. writing in


Put spaces after the commas:
Nokia 252, 282, 5/6/7100, 8200, 8800 AC

I think that's what the OP wants to avoid, or else the OP would have not
said "For the experts". Maybe some of this data is fetched in its raw form
from a database...

Roy
 
J

Jukka K. Korpela

Roy Schestowitz said:
I think that's what the OP wants to avoid, or else the OP would
have not said "For the experts".

Well, "For the experts" is the common way of telling experts not to
bother - a pathetic attempt at making people interested in something
that isn't interesting by its nature. In this case however the Subject
line potentially made people interested _despite_ the attempt.

In addition to various techniques of suggesting line breaks inside a
string, there's the approach of using spaces, which would indeed be the
logical and orthographically correct approach. If saving space is a
matter of life and death (though it's usually just a problem created on
purpose, by using some fancy "layout" and "design" that squeezes
content proper into stamp size), then you could use CSS to suggest
reduction of inter-word spacing, e.g.
<span style="word-spacing:-0.2em">252, 282, 5/6/7100, 8200,
8800 AC</span>
 
C

Carolyn Marenger

If you copy and paste the html below to a file with an .htm extension and
open it in IE 6.0, you'll notice that the text with the word "Nokia" in it
DOES NOT WRAP to the size of the table. It seems to think this is a long
word or something...

HOW can I get this text to wrap, even if I have to use some code to change
the string somehow? Maybe a style class or something would wrap it?

I need this to wrap!

Any response would be highly regarded!

Try replacing the line with this:

<a
href="?qT=3&amp;m=11&amp;ct=35&amp;cpg=1&amp;sz=l&amp;pid=9271&amp;showDetail=true">Nokia
252, 282, 5/6/7100, 8200, 8800 AC</a>

Gramatically, it is correct to put a space after a comma. Whitespace is
where browsers will wrap. So, put a space after each comma and voila, it
wraps.

Carolyn
 
T

Toby Inkster

Roy said:
Maybe some of this data is fetched in its raw form from a database...

So?

$phonemodel = &get_from_datavase();
$phonemodel =~ s/\,/\, /g;
print $phonemodel;
 
D

DrLovely

If you copy and paste the html below to a file with an .htm extension
and open it in IE 6.0, you'll notice that the text with the word
"Nokia" in it DOES NOT WRAP to the size of the table. It seems to
think this is a long word or something...
ETC....

Thanks everyone. The string does come from the database, and I use
ASP, so

<%=replace(rs("field_one"),",",", ") %>

Does the trick. I did this before but I must have reversed the space
and comma , and that didn't work so I gave up on the space thing.
Duh.

By the way, some of you are just plain smarmy beatches (sic), aren't
you? OF COURSE I want the attention of experts; geeeez.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top