473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

question about wrapping a string

this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a variable,
then uses <%= variable %to write the text inside an html table. the
problem im having has to do with wrapping. if the line of text is longer
than the table (or column) is wide, then the whole table is blown apart and
grows to fit the data. i was hoping for an easy way to fix this with CSS but
the only thing i can find that works is the wordwrap tag that ONLY IE
supports! so unless someone here knows how i can deal with this in css/html,
i will have to look at the Len() of the string and if its over a certain
amount of characters ill have to insert a <brat every Nth character. does
anyone have any ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone know how to
do this in css? and if not, can someone show me how i might insert <br>'s
into my string at every 20th character or so?

thanks
Sep 28 '06 #1
28 1695
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a
variable, then uses <%= variable %to write the text inside an html
table. the problem im having has to do with wrapping. if the line of
text is longer than the table (or column) is wide, then the whole
table is blown apart and grows to fit the data. i was hoping for an
easy way to fix this with CSS but the only thing i can find that works
is the wordwrap tag that ONLY IE supports! so unless someone here
knows how i can deal with this in css/html, i will have to look at the
Len() of the string and if its over a certain amount of characters ill
have to insert a <brat every Nth character. does anyone have any
ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone know
how to do this in css? and if not, can someone show me how i might
insert <br>'s into my string at every 20th character or so?
It is totally off topic, since it is a clientside css matter.

Please ask in a css NG.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 28 '06 #2
did you read the whole problem?
i asked for help with a string in ASP. how is that off topic? why dont you
go read the whole problem and respond again


"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
>this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a
variable, then uses <%= variable %to write the text inside an html
table. the problem im having has to do with wrapping. if the line of
text is longer than the table (or column) is wide, then the whole
table is blown apart and grows to fit the data. i was hoping for an
easy way to fix this with CSS but the only thing i can find that works
is the wordwrap tag that ONLY IE supports! so unless someone here
knows how i can deal with this in css/html, i will have to look at the
Len() of the string and if its over a certain amount of characters ill
have to insert a <brat every Nth character. does anyone have any
ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone know
how to do this in css? and if not, can someone show me how i might
insert <br>'s into my string at every 20th character or so?

It is totally off topic, since it is a clientside css matter.

Please ask in a css NG.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 28 '06 #3
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
>Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
>>this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a
variable, then uses <%= variable %to write the text inside an html
table. the problem im having has to do with wrapping. if the line of
text is longer than the table (or column) is wide, then the whole
table is blown apart and grows to fit the data. i was hoping for an
easy way to fix this with CSS but the only thing i can find that
works is the wordwrap tag that ONLY IE supports! so unless someone
here knows how i can deal with this in css/html, i will have to look
at the Len() of the string and if its over a certain amount of
characters ill have to insert a <brat every Nth character. does
anyone have any ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone
know how to do this in css? and if not, can someone show me how i
might insert <br>'s into my string at every 20th character or so?

It is totally off topic, since it is a clientside css matter.

Please ask in a css NG.
[please do not toppost on usenet. Corrected.]
did you read the whole problem?
i asked for help with a string in ASP. how is that off topic? why dont
you go read the whole problem and respond again
so if I ask ...
<% = "Goede morgen" %>
Please translate the text in English?
.... it is an asp problem?

No, your problem can and schould be tackled with css,
like my above example in news:sci.lang.translation.

So please ask in news:comp.infosystems.www.authoring.stylesheets.
>>and if not, can someone show me how i
might insert <br>'s into my string at every 20th character or so?
So as I answered that css is the solution,
the Q is totally off topic,
since the "if not" does not apply when there is an css solution,
as you stipulated yourself!
>>might insert <br>'s into my string at every 20th character or so?
.... which should make your string unreadable anyway.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 28 '06 #4
please dont bottom post, it annoys most of us.

no, it cant be handled in CSS because IE is the only browser that supports
the necessary tag (you should do more research before you answer)

so, again, since i will be displaying text in a fixed width column, how can
i take a string, loop through the characters, and insert a <brat a
specific character count? is that on topic enough for you?

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
>"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
>>Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:

this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a
variable, then uses <%= variable %to write the text inside an html
table. the problem im having has to do with wrapping. if the line of
text is longer than the table (or column) is wide, then the whole
table is blown apart and grows to fit the data. i was hoping for an
easy way to fix this with CSS but the only thing i can find that
works is the wordwrap tag that ONLY IE supports! so unless someone
here knows how i can deal with this in css/html, i will have to look
at the Len() of the string and if its over a certain amount of
characters ill have to insert a <brat every Nth character. does
anyone have any ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone
know how to do this in css? and if not, can someone show me how i
might insert <br>'s into my string at every 20th character or so?

It is totally off topic, since it is a clientside css matter.

Please ask in a css NG.

[please do not toppost on usenet. Corrected.]
>did you read the whole problem?
i asked for help with a string in ASP. how is that off topic? why dont
you go read the whole problem and respond again

so if I ask ...
<% = "Goede morgen" %>
Please translate the text in English?
... it is an asp problem?

No, your problem can and schould be tackled with css,
like my above example in news:sci.lang.translation.

So please ask in news:comp.infosystems.www.authoring.stylesheets.
>>>and if not, can someone show me how i
might insert <br>'s into my string at every 20th character or so?

So as I answered that css is the solution,
the Q is totally off topic,
since the "if not" does not apply when there is an css solution,
as you stipulated yourself!
>>>might insert <br>'s into my string at every 20th character or so?

... which should make your string unreadable anyway.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 28 '06 #5
Joe Reynolds wrote:
i want that <tdto stay at 250 wide no matter what! does anyone
know how to do this in css? and if not, can someone show me how
i might insert <br>'s into my string at every 20th character or
so?
Yes, and Evertjan is correct. This really is not an ASP issue. It is a
presentation issue.

You can solve your problem by nesting a DIV container inside the TD and
styling the DIV with "width:250px;". Alternately, you can try using the
fixed table layout:
http://www.w3.org/TR/CSS21/tables.ht...d-table-layout

CSS2 also defines a "max-width" property, but (a) I don't think it is widely
implemented, and (b) it probably suffers the same problem when applied to
table cells:
http://www.w3.org/TR/CSS21/visudet.h...pdef-max-width

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 28 '06 #6
hey thank you.
unfortunately the div method doesnt work.

so now since i need an asp solution.... LOL

how can i loop through the string and insert a <brevery 20th character?
any ideas?


"Dave Anderson" <NY**********@spammotel.comwrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
Joe Reynolds wrote:
>i want that <tdto stay at 250 wide no matter what! does anyone
know how to do this in css? and if not, can someone show me how
i might insert <br>'s into my string at every 20th character or
so?

Yes, and Evertjan is correct. This really is not an ASP issue. It is a
presentation issue.

You can solve your problem by nesting a DIV container inside the TD and
styling the DIV with "width:250px;". Alternately, you can try using the
fixed table layout:
http://www.w3.org/TR/CSS21/tables.ht...d-table-layout

CSS2 also defines a "max-width" property, but (a) I don't think it is
widely implemented, and (b) it probably suffers the same problem when
applied to table cells:
http://www.w3.org/TR/CSS21/visudet.h...pdef-max-width

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms.

Sep 28 '06 #7
[please do not toppost]

Joe Reynolds wrote:
please dont bottom post, it annoys most o
f us. no, it cant be handled in CSS becau
se IE is the only browser that supports t
he necessary tag (you should do more rese
arch before you answer)

so, again, since i will be displaying tex
t in a fixed width column, how can i take
a string, loop through the characters, an
d insert a <brat a specific character c
ount? is that on topic enough for you?
Is that really what you want your text to look like? Rather unreadable, if
you ask me. But I guess there is no stopping you from doing this:

for (
var a=[], i=0;
i<variable.length;
a.push(variable.substring(i,i+=20))
)

output = a.join("<br>")

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 28 '06 #8
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
please dont bottom post, it annoys most of us.
You are wrong, depending on what you mean with "us".

I did not ask you [politely] not to toppost,
as it is against usenet netiquette.

I did not ask you to bottompost.

Bottom posting is not the alternative of topposting,
no, it cant be handled in CSS because IE is the only browser that
supports the necessary tag
You are wrong, it can be.
What "tag" are you talking about? style='' ?
(you should do more research before you answer)
It seems to me, you, as the asking party, you could be more polite,
when people try to answer you, even if you do not like the answer,
thinking you know better.

Why were you asking about css anyway,
when you are so sure that is not the answer?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 28 '06 #9
actually, bottom posting does indeed annoy 50% of "us", and by us i mean the 50% of newsgroup users that like to "top post" because it is more natural, it is how email works, and it is the default for most news readers. but i dont imagine youll get into this discussion for the millionth time. it is a preference. mine is different than yours, learn to live with it.

as for the style tag, i am referring to the IE only tag, "word-wrap: break-word" which will wrap text once it reaches the limit of the container it is in. other than that, as far as i know there is nothig else. a DIV tag would work, unless its a string with no spaces, then that too fails.

so what is your solution?


"Evertjan." <ex**************@interxnl.netwrote in message news:Xn********************@194.109.133.242...
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
>please dont bottom post, it annoys most of us.
You are wrong, depending on what you mean with "us".

I did not ask you [politely] not to toppost,
as it is against usenet netiquette.

I did not ask you to bottompost.

Bottom posting is not the alternative of topposting,
>no, it cant be handled in CSS because IE is the only browser that
supports the necessary tag
You are wrong, it can be.
What "tag" are you talking about? style='' ?
>(you should do more research before you answer)
It seems to me, you, as the asking party, you could be more polite,
when people try to answer you, even if you do not like the answer,
thinking you know better.

Why were you asking about css anyway,
when you are so sure that is not the answer?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 28 '06 #10
wrote on 29 Sep 2006 in microsoft.public.inetserver.asp.general:
actually, bottom posting does indeed annoy 50% of "us",
No matter, who was talking or doing bottom posting?
And did you do a survey?
How did you reach this 50%?
and by us i
mean the 50% of newsgroup users that like to "top post" because it is
more natural, it is how email works,
So you think posting in usenet is email? Strange.

"Natural", that argumant n the negative goes way back in Europe.
and it is the default for most news readers.
Not at all IMHO.
How many newsreaders did you inspect?
How do you measure "default"?
And would that be a valid argument?
but i dont imagine youll get into this discussion for
the millionth time. it is a preference. mine is different than yours,
I am not discussing, I only politely ask not to toppost, because it is
against usenet netiquette, backed by an experience of usenet that is
twice as long as the web.
learn to live with it.
If you are happy, why do you respond?
as for the style tag, i am referring
I do not know who "I" is, as you are not identifying yourself.
Did you post earlier in this thread?
to the IE only tag, "word-wrap:
break-word" which will wrap text once it reaches the limit of the
container it is in. other than that, as far as i know there is nothig
else. a DIV tag would work, unless its a string with no spaces, then
that too fails.

so what is your solution?
My advice in this ASP NG is: ask in a css NG. It is off topic here.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 28 '06 #11
nothing like arguing with someone that doesnt speak english
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn*******************@194.109.133.242...
wrote on 29 Sep 2006 in microsoft.public.inetserver.asp.general:
>actually, bottom posting does indeed annoy 50% of "us",

No matter, who was talking or doing bottom posting?
And did you do a survey?
How did you reach this 50%?
>and by us i
mean the 50% of newsgroup users that like to "top post" because it is
more natural, it is how email works,

So you think posting in usenet is email? Strange.

"Natural", that argumant n the negative goes way back in Europe.
>and it is the default for most news readers.

Not at all IMHO.
How many newsreaders did you inspect?
How do you measure "default"?
And would that be a valid argument?
>but i dont imagine youll get into this discussion for
the millionth time. it is a preference. mine is different than yours,

I am not discussing, I only politely ask not to toppost, because it is
against usenet netiquette, backed by an experience of usenet that is
twice as long as the web.
>learn to live with it.

If you are happy, why do you respond?
>as for the style tag, i am referring

I do not know who "I" is, as you are not identifying yourself.
Did you post earlier in this thread?
>to the IE only tag, "word-wrap:
break-word" which will wrap text once it reaches the limit of the
container it is in. other than that, as far as i know there is nothig
else. a DIV tag would work, unless its a string with no spaces, then
that too fails.

so what is your solution?

My advice in this ASP NG is: ask in a css NG. It is off topic here.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 28 '06 #12
>how can i loop through the string and insert a <brevery 20th character?
any ideas?

How is that going to look if the viewer has their font size set differently
than yours?

Bob Lehmann

"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
hey thank you.
unfortunately the div method doesnt work.

so now since i need an asp solution.... LOL

how can i loop through the string and insert a <brevery 20th character?
any ideas?


"Dave Anderson" <NY**********@spammotel.comwrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
Joe Reynolds wrote:
i want that <tdto stay at 250 wide no matter what! does anyone
know how to do this in css? and if not, can someone show me how
i might insert <br>'s into my string at every 20th character or
so?
Yes, and Evertjan is correct. This really is not an ASP issue. It is a
presentation issue.

You can solve your problem by nesting a DIV container inside the TD and
styling the DIV with "width:250px;". Alternately, you can try using the
fixed table layout:
http://www.w3.org/TR/CSS21/tables.ht...d-table-layout

CSS2 also defines a "max-width" property, but (a) I don't think it is
widely implemented, and (b) it probably suffers the same problem when
applied to table cells:
http://www.w3.org/TR/CSS21/visudet.h...pdef-max-width

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms.


Sep 28 '06 #13

no@spam.com wrote:
nothing like arguing with someone that doesnt speak english

Hello again "Jimmy". Still making friends and influencing people, I
see....

--
Mike Brind

Sep 29 '06 #14

"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
this is kinda off topic, but not totally.

i have an ASP page that pulls text from a database, stores it in a
variable,
then uses <%= variable %to write the text inside an html table. the
problem im having has to do with wrapping. if the line of text is longer
than the table (or column) is wide, then the whole table is blown apart
and
grows to fit the data. i was hoping for an easy way to fix this with CSS
but
the only thing i can find that works is the wordwrap tag that ONLY IE
supports! so unless someone here knows how i can deal with this in
css/html,
i will have to look at the Len() of the string and if its over a certain
amount of characters ill have to insert a <brat every Nth character.
does
anyone have any ideas? my table might look like this:

<table width="500+>
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i want that <tdto stay at 250 wide no matter what! does anyone know how
to
do this in css? and if not, can someone show me how i might insert <br>'s
into my string at every 20th character or so?

thanks

Have you tried the style table-layout:fixed on the table? can't remember if
this is a standard or not.

It seems inconceivable to me that a solution can't be found to this using
Standard CSS styles. Which is probably why we aren't forth coming with an
'ASP' solution. If you haven't already done so you might consider posting
this problem to a more HTML/CSS oriented group where people who eat and
drink CSS all day hang out. At least you should be able to procure a
definitive "no it can't be done" before writing an ASP workaround which is
likely to fall short anyway.


Sep 29 '06 #15
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>
how can i loop through the string and insert a <brevery 20th
character?
any ideas?

How is that going to look if the viewer has their font size set
differently than yours?
Instead of <bryou could use the zero-width space. Note that IE
(perhaps among others) does not have complete support for this
character, so you will need to use a font that has a glyph for it.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Zero-width Space Test</title>
<style type="text/css">p { font-family: 'MS UI Gothic'; }</style>
<p>1234567890&#x200b;1234567890&#x200b;1234567890& #x200b;

Alternately, since IE will correctly wrap on the character even if it is
not able to display it properly, you could wrap it in a zero-width
<span>.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Zero-width Space Test</title>
<style type="text/css">
span {
display: inline-block;
display: -moz-inline-block;
width: 0;
overflow: hidden;
}
</style>
<p>1234567890<span>&#x200b;</span>1234567890<span>&#x200b;</span>1234

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Sep 29 '06 #16
yeah, its just a shame that as soon as someone comes here and asks for help
the first thing they get is an arrogant non english speaking person going
over the whole top-posting thing yet again

"Mike Brind" <pa*******@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
>
no@spam.com wrote:
>nothing like arguing with someone that doesnt speak english


Hello again "Jimmy". Still making friends and influencing people, I
see....

--
Mike Brind

Sep 29 '06 #17
So you are rascist too.

What a piece of work.

--

Joe Reynolds wrote:
yeah, its just a shame that as soon as someone comes here and asks for help
the first thing they get is an arrogant non english speaking person going
over the whole top-posting thing yet again

"Mike Brind" <pa*******@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...

no@spam.com wrote:
nothing like arguing with someone that doesnt speak english

Hello again "Jimmy". Still making friends and influencing people, I
see....

--
Mike Brind
Sep 29 '06 #18
top posting are we?

racist... yes, yes i am. arent you?

dumbass
"Mike Brind" <pa*******@hotmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
So you are rascist too.

What a piece of work.

--

Joe Reynolds wrote:
>yeah, its just a shame that as soon as someone comes here and asks for
help
the first thing they get is an arrogant non english speaking person going
over the whole top-posting thing yet again

"Mike Brind" <pa*******@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegr oups.com...
>
no@spam.com wrote:
nothing like arguing with someone that doesnt speak english

Hello again "Jimmy". Still making friends and influencing people, I
see....

--
Mike Brind

Sep 29 '06 #19
What I'm getting at is that the font size may cause the text wrap in
addition to the <br>s the OP is trying to implement in his dopey solution.

Font - medium....

blah stupid idea blah.... 20thWord<br>
blah blah blah

Font - large.....
blah stupid idea
blah.... 20thWord<br>
blah blah blah

Bob Lehmann

"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
how can i loop through the string and insert a <brevery 20th
character?
any ideas?
How is that going to look if the viewer has their font size set
differently than yours?

Instead of <bryou could use the zero-width space. Note that IE
(perhaps among others) does not have complete support for this
character, so you will need to use a font that has a glyph for it.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Zero-width Space Test</title>
<style type="text/css">p { font-family: 'MS UI Gothic'; }</style>
<p>1234567890&#x200b;1234567890&#x200b;1234567890& #x200b;

Alternately, since IE will correctly wrap on the character even if it is
not able to display it properly, you could wrap it in a zero-width
<span>.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Zero-width Space Test</title>
<style type="text/css">
span {
display: inline-block;
display: -moz-inline-block;
width: 0;
overflow: hidden;
}
</style>
<p>1234567890<span>&#x200b;</span>1234567890<span>&#x200b;</span>1234

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

Sep 29 '06 #20
On Fri, 29 Sep 2006 17:03:57 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
>On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann
<no****@dontbotherme.zzz>
wrote:
"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

how can i loop through the string and insert a <brevery 20th
character?
any ideas?

How is that going to look if the viewer has their font size set
differently than yours?

Instead of <bryou could use the zero-width space.
What I'm getting at is that the font size may cause the text wrap in
addition to the <br>s the OP is trying to implement in his dopey
solution.

Font - medium....

blah stupid idea blah.... 20thWord<br>
blah blah blah

Font - large.....
blah stupid idea
blah.... 20thWord<br>
blah blah blah
Right, <bris a hard linebreak, and so the line will be broken even
when it is not necessary. The zero-width space is just an invisible
space, so if there is not room for the entire word there would still at
least be a place where the line *can* be broken.

That said, I also should have mentioned earlier that this character will
usually be included if you copy and paste text containing it, which may
be a problem in some scenarios. One in particular which comes to mind is
content which contains very long URLs as plain text. Obviously pasting
www.goo&#x200b;gle.com into your browser will not produce the desired
effect.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Sep 29 '06 #21
>Right, <bris a hard linebreak

Right. That is what the OP is trying to accomplish. He's vainly trying to
format his text using <brso lines don't exceed his <tdwidth.

What he's come to realize, is that normal text would wrap on its own, so now
he's figured out that his <tdhas room for a 40 character string, and is
trying to limit each "word" to 40 characters - another dopey solution - so
there are enough "words" to wrap.

Bob Lehmann

"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
On Fri, 29 Sep 2006 17:03:57 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann
<no****@dontbotherme.zzz>
wrote:

"Joe Reynolds" <js@js.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

how can i loop through the string and insert a <brevery 20th
character?
any ideas?

How is that going to look if the viewer has their font size set
differently than yours?

Instead of <bryou could use the zero-width space.
What I'm getting at is that the font size may cause the text wrap in
addition to the <br>s the OP is trying to implement in his dopey
solution.

Font - medium....

blah stupid idea blah.... 20thWord<br>
blah blah blah

Font - large.....
blah stupid idea
blah.... 20thWord<br>
blah blah blah

Right, <bris a hard linebreak, and so the line will be broken even
when it is not necessary. The zero-width space is just an invisible
space, so if there is not room for the entire word there would still at
least be a place where the line *can* be broken.

That said, I also should have mentioned earlier that this character will
usually be included if you copy and paste text containing it, which may
be a problem in some scenarios. One in particular which comes to mind is
content which contains very long URLs as plain text. Obviously pasting
www.goo&#x200b;gle.com into your browser will not produce the desired
effect.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

Sep 30 '06 #22
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
>Right, <bris a hard linebreak

Right. That is what the OP is trying to accomplish. He's vainly trying
to format his text using <brso lines don't exceed his <tdwidth.

What he's come to realize, is that normal text would wrap on its own,
so now he's figured out that his <tdhas room for a 40 character
string, and is trying to limit each "word" to 40 characters - another
dopey solution - so there are enough "words" to wrap.
It's a bletcherous hack of a solution, but no more so than any
alternative I can think of. You could just clip long words using
overflow: hidden, but that would hide information the visitor needs. You
can, as the OP notes, cause IE to break long words at arbitrary points,
but only IE.

You could simply allow long words to extend past the edge of the content
area. This would be the solution I would normally favor, however it is
not appropriate in all situations, as it requires that there be no other
content to the right that would be obscured. Also, special consideration
must be given to IE to avoid excessive horizontal scrolling, as it will
expand the entire content area to contain the unwrappable word.

I suppose something could conceivably be done using client-side script.
That could potentially be pretty slick, but it leaves the taste of
over-engineering in my mouth. Is there another option I've neglected?

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Oct 2 '06 #23
SLH

"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann <no****@dontbotherme.zzz>
wrote:
>>Right, <bris a hard linebreak

Right. That is what the OP is trying to accomplish. He's vainly trying
to format his text using <brso lines don't exceed his <tdwidth.

What he's come to realize, is that normal text would wrap on its own,
so now he's figured out that his <tdhas room for a 40 character
string, and is trying to limit each "word" to 40 characters - another
dopey solution - so there are enough "words" to wrap.

It's a bletcherous hack of a solution, but no more so than any
alternative I can think of. You could just clip long words using
overflow: hidden, but that would hide information the visitor needs. You
can, as the OP notes, cause IE to break long words at arbitrary points,
but only IE.

You could simply allow long words to extend past the edge of the content
area. This would be the solution I would normally favor, however it is
not appropriate in all situations, as it requires that there be no other
content to the right that would be obscured. Also, special consideration
must be given to IE to avoid excessive horizontal scrolling, as it will
expand the entire content area to contain the unwrappable word.

I suppose something could conceivably be done using client-side script.
That could potentially be pretty slick, but it leaves the taste of
over-engineering in my mouth. Is there another option I've neglected?

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

im going to go with clipping long text. as i see it, any line that is so
long it cant be displayed properly is just an attempt to screw up my layout
or database anyway. so why worry about displaying it properly?

Oct 2 '06 #24
>just an attempt to screw up my layout or database anyway. so why worry
about displaying it properly?

Spoken like a true dumba**.

Bob Lehmann

"SLH" <SL*@SLH.SLHwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>
"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.co m...
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann
<no****@dontbotherme.zzz>
wrote:
>Right, <bris a hard linebreak

Right. That is what the OP is trying to accomplish. He's vainly trying
to format his text using <brso lines don't exceed his <tdwidth.

What he's come to realize, is that normal text would wrap on its own,
so now he's figured out that his <tdhas room for a 40 character
string, and is trying to limit each "word" to 40 characters - another
dopey solution - so there are enough "words" to wrap.
It's a bletcherous hack of a solution, but no more so than any
alternative I can think of. You could just clip long words using
overflow: hidden, but that would hide information the visitor needs. You
can, as the OP notes, cause IE to break long words at arbitrary points,
but only IE.

You could simply allow long words to extend past the edge of the content
area. This would be the solution I would normally favor, however it is
not appropriate in all situations, as it requires that there be no other
content to the right that would be obscured. Also, special consideration
must be given to IE to avoid excessive horizontal scrolling, as it will
expand the entire content area to contain the unwrappable word.

I suppose something could conceivably be done using client-side script.
That could potentially be pretty slick, but it leaves the taste of
over-engineering in my mouth. Is there another option I've neglected?

--
Justin Piper
Bizco Technologies
http://www.bizco.com/


im going to go with clipping long text. as i see it, any line that is so
long it cant be displayed properly is just an attempt to screw up my
layout
or database anyway. so why worry about displaying it properly?

Oct 2 '06 #25
SLH
dumba**?
are you serious?

"Bob Lehmann" <no****@dontbotherme.zzzwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>just an attempt to screw up my layout or database anyway. so why worry
about displaying it properly?

Spoken like a true dumba**.

Bob Lehmann

"SLH" <SL*@SLH.SLHwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>
"Justin Piper" <jp****@bizco.comwrote in message
news:op***************@luxembourg.psg.bizcotech.c om...
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann
<no****@dontbotherme.zzz>
wrote:

Right, <bris a hard linebreak

Right. That is what the OP is trying to accomplish. He's vainly trying
to format his text using <brso lines don't exceed his <tdwidth.

What he's come to realize, is that normal text would wrap on its own,
so now he's figured out that his <tdhas room for a 40 character
string, and is trying to limit each "word" to 40 characters - another
dopey solution - so there are enough "words" to wrap.

It's a bletcherous hack of a solution, but no more so than any
alternative I can think of. You could just clip long words using
overflow: hidden, but that would hide information the visitor needs.
You
can, as the OP notes, cause IE to break long words at arbitrary points,
but only IE.

You could simply allow long words to extend past the edge of the
content
area. This would be the solution I would normally favor, however it is
not appropriate in all situations, as it requires that there be no
other
content to the right that would be obscured. Also, special
consideration
must be given to IE to avoid excessive horizontal scrolling, as it will
expand the entire content area to contain the unwrappable word.

I suppose something could conceivably be done using client-side script.
That could potentially be pretty slick, but it leaves the taste of
over-engineering in my mouth. Is there another option I've neglected?

--
Justin Piper
Bizco Technologies
http://www.bizco.com/


im going to go with clipping long text. as i see it, any line that is so
long it cant be displayed properly is just an attempt to screw up my
layout
>or database anyway. so why worry about displaying it properly?


Oct 3 '06 #26
Bob Lehmann wrote:
>>just an attempt to screw up my layout or database anyway.
so why worry about displaying it properly?

Spoken like a true dumba**.
I'm not sure I completely agree, Bob. The CSS approach
"width:NNNpx;overflow:hidden" is a quick fix that cures the immediate
problem of users entering long, meaningless strings. It *does* present a
potential problem for someone who needs a huge font.

Obviously, the real cure to the problem is rejection of that text from the
beginning. But I don't think he is being entirely unreasonable in this
circumstance.

[1] Many browsers, among them Firefox, support minimum font sizes regardless
of the author's wishes.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Oct 3 '06 #27
SLH wrote:
im going to go with clipping long text. as i see it, any line that is
so long it cant be displayed properly is just an attempt to screw up
my layout or database anyway. so why worry about displaying it
properly?
So why not simply reject it instead of going to the trouble of modifying
it?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 3 '06 #28
SLH
i have long since implemented a function that rejects text that i determine
to be invalid

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:ec**************@TK2MSFTNGP03.phx.gbl...
SLH wrote:
>im going to go with clipping long text. as i see it, any line that is
so long it cant be displayed properly is just an attempt to screw up
my layout or database anyway. so why worry about displaying it
properly?

So why not simply reject it instead of going to the trouble of modifying
it?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Oct 3 '06 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: yawnmoth | last post by:
word wrapping normally treats some spaces as line feeds, if there hasn't been a line feed for quite a while. so while a string with eighty consecutive a's might not word wrap, a space placed...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
16
by: dario | last post by:
Hi, Im new on phyton programming. On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive a string from serial port and after send this one enclosed in an e-mail. All OK if the...
5
by: nimdez | last post by:
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion...
10
by: Douglas G | last post by:
I've tried various ideas on this problem, but I don't see word wrapping. Can you point out what is wrong? It's a K&R exercise, and I'm still new to programming. Other pointers would be helpful...
4
by: phl | last post by:
hi, My question is: 1. To avoid possible memory leaks, when you use this pattern, after you have dealth with the unmanaged resources and before you take your object off the finalize queue,...
25
by: Brian | last post by:
Can some one please tell me what I'm doing wrong. I'm trying to create a class called Dog, but Visual Basic tells me that I can't enter Wolf.age....why is this? Public Class Form1 Public Class...
6
by: Greg Esres | last post by:
I have some text lines to print that are much longer than the width of the paper, maybe as much as 6 times. For a given page, I'd like everything that doesn't fit to print on a second page, and...
35
by: rebeccatre | last post by:
hi can Variant archiving setTimout('.. capability be done without using it? :-)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.