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 | | | | re: question about wrapping a string
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general: Quote:
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) | | | | re: question about wrapping a string
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." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns984CDD82E3249eejj99@194.109.133.242... Quote:
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general:
> Quote:
>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)
| | | | re: question about wrapping a string
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general: Quote:
"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns984CDD82E3249eejj99@194.109.133.242... Quote:
>Joe Reynolds wrote on 28 Sep 2006 in
>microsoft.public.inetserver.asp.general:
>> Quote:
>>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.] Quote:
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. Quote: Quote: Quote:
>>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! Quote: Quote: Quote:
>>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) | | | | re: question about wrapping a string
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." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns984CE379D1DFDeejj99@194.109.133.242... Quote:
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general: Quote:
>"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
>news:Xns984CDD82E3249eejj99@194.109.133.242... Quote:
>>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.]
> Quote:
>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.
> Quote: Quote:
>>>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!
> Quote: Quote:
>>>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)
| | | | re: question about wrapping a string
Joe Reynolds wrote: Quote:
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. | | | | re: question about wrapping a string
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" <NYRUMTPELVWH@spammotel.comwrote in message
news:u%23Bjm1z4GHA.1012@TK2MSFTNGP05.phx.gbl... Quote:
Joe Reynolds wrote: Quote:
>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.
>
| | | | re: question about wrapping a string
[please do not toppost]
Joe Reynolds wrote: Quote:
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. | | | | re: question about wrapping a string
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general: Quote:
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, Quote:
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='' ? Quote:
(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) | | | | re: question about wrapping a string
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." <exjxw.hannivoort@interxnl.netwrote in message news:Xns984CED876DDE6eejj99@194.109.133.242... Quote:
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.public.inetserver.asp.general: Quote:
>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, Quote:
>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='' ? Quote:
>(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)
| | | | re: question about wrapping a string
wrote on 29 Sep 2006 in microsoft.public.inetserver.asp.general: Quote:
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%? Quote:
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. Quote:
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? Quote:
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. Quote:
learn to live with it.
If you are happy, why do you respond? Quote:
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? Quote:
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) | | | | re: question about wrapping a string
nothing like arguing with someone that doesnt speak english
"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns984D3FA86238eejj99@194.109.133.242... Quote:
wrote on 29 Sep 2006 in microsoft.public.inetserver.asp.general:
> Quote:
>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%?
> Quote:
>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.
> Quote:
>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?
> Quote:
>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.
> Quote:
>learn to live with it.
>
If you are happy, why do you respond?
> Quote:
>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?
> Quote:
>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)
| | | | re: question about wrapping a string
>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:%23wFZO6z4GHA.3512@TK2MSFTNGP04.phx.gbl... Quote:
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" <NYRUMTPELVWH@spammotel.comwrote in message
news:u%23Bjm1z4GHA.1012@TK2MSFTNGP05.phx.gbl... Quote:
Joe Reynolds wrote: Quote:
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.
>
>
| | | | re: question about wrapping a string no@spam.com wrote: Quote:
nothing like arguing with someone that doesnt speak english
>
>
Hello again "Jimmy". Still making friends and influencing people, I
see....
--
Mike Brind | | | | re: question about wrapping a string
"Joe Reynolds" <js@js.comwrote in message
news:%23GI5bYz4GHA.3840@TK2MSFTNGP06.phx.gbl... Quote:
this is kinda off topic, but not totally.
>
i have an ASP page that pulls text from a database, stores it in a
variable, Quote:
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 Quote:
grows to fit the data. i was hoping for an easy way to fix this with CSS
but Quote:
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, Quote:
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 Quote:
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 Quote:
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. | | | | re: question about wrapping a string
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote: Quote:
"Joe Reynolds" <js@js.comwrote in message
news:%23wFZO6z4GHA.3512@TK2MSFTNGP04.phx.gbl... Quote:
>>
>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​1234567890​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>​</span>1234567890<span>​</span>1234
--
Justin Piper
Bizco Technologies http://www.bizco.com/ | | | | re: question about wrapping a string
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" <paxtonend@hotmail.comwrote in message
news:1159513695.508935.185160@i3g2000cwc.googlegro ups.com... Quote:
> no@spam.com wrote: Quote:
>nothing like arguing with someone that doesnt speak english
>>
>>
>
Hello again "Jimmy". Still making friends and influencing people, I
see....
>
--
Mike Brind
>
| | | | re: question about wrapping a string
So you are rascist too.
What a piece of work.
--
Joe Reynolds wrote: Quote:
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" <paxtonend@hotmail.comwrote in message
news:1159513695.508935.185160@i3g2000cwc.googlegro ups.com... Quote: no@spam.com wrote: Quote:
nothing like arguing with someone that doesnt speak english
>
>
Hello again "Jimmy". Still making friends and influencing people, I
see....
--
Mike Brind
| | | | re: question about wrapping a string
top posting are we?
racist... yes, yes i am. arent you?
dumbass
"Mike Brind" <paxtonend@hotmail.comwrote in message
news:1159558230.958709.98510@m73g2000cwd.googlegro ups.com... Quote:
So you are rascist too.
>
What a piece of work.
>
--
>
Joe Reynolds wrote: Quote:
>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" <paxtonend@hotmail.comwrote in message
>news:1159513695.508935.185160@i3g2000cwc.googlegr oups.com... Quote:
> 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
>
>
| | | | re: question about wrapping a string
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" <jpiper@bizco.comwrote in message
news:op.tgm8i1vvcs3d1w@luxembourg.psg.bizcotech.co m... Quote:
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote:
> Quote:
"Joe Reynolds" <js@js.comwrote in message
news:%23wFZO6z4GHA.3512@TK2MSFTNGP04.phx.gbl... Quote:
>
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​1234567890​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>​</span>1234567890<span>​</span>1234
>
--
Justin Piper
Bizco Technologies http://www.bizco.com/ | | | | re: question about wrapping a string
On Fri, 29 Sep 2006 17:03:57 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote: Quote:
"Justin Piper" <jpiper@bizco.comwrote in message
news:op.tgm8i1vvcs3d1w@luxembourg.psg.bizcotech.co m... Quote:
>On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann
><nospam@dontbotherme.zzz>
>wrote:
>> Quote:
"Joe Reynolds" <js@js.comwrote in message
news:%23wFZO6z4GHA.3512@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​gle.com into your browser will not produce the desired
effect.
--
Justin Piper
Bizco Technologies http://www.bizco.com/ | | | | re: question about wrapping a string
>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" <jpiper@bizco.comwrote in message
news:op.tgnyvdplcs3d1w@luxembourg.psg.bizcotech.co m... Quote:
On Fri, 29 Sep 2006 17:03:57 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote:
> Quote:
"Justin Piper" <jpiper@bizco.comwrote in message
news:op.tgm8i1vvcs3d1w@luxembourg.psg.bizcotech.co m... Quote:
On Thu, 28 Sep 2006 18:09:34 -0500, Bob Lehmann
<nospam@dontbotherme.zzz>
wrote:
>
"Joe Reynolds" <js@js.comwrote in message
news:%23wFZO6z4GHA.3512@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​gle.com into your browser will not produce the desired
effect.
>
--
Justin Piper
Bizco Technologies http://www.bizco.com/ | | | | re: question about wrapping a string
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote: Quote: Quote:
>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/ | | | | re: question about wrapping a string
"Justin Piper" <jpiper@bizco.comwrote in message
news:op.tgsu4tyecs3d1w@luxembourg.psg.bizcotech.co m... Quote:
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann <nospam@dontbotherme.zzz>
wrote:
> Quote: Quote:
>>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? | | | | re: question about wrapping a string
>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" <SLH@SLH.SLHwrote in message
news:%237XiHbj5GHA.1248@TK2MSFTNGP03.phx.gbl... Quote:
>
"Justin Piper" <jpiper@bizco.comwrote in message
news:op.tgsu4tyecs3d1w@luxembourg.psg.bizcotech.co m... Quote:
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann
<nospam@dontbotherme.zzz> Quote: Quote:
wrote: Quote:
>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 Quote:
or database anyway. so why worry about displaying it properly?
>
>
>
| | | | re: question about wrapping a string
dumba**?
are you serious?
"Bob Lehmann" <nospam@dontbotherme.zzzwrote in message
news:%23AjweGn5GHA.1256@TK2MSFTNGP04.phx.gbl... Quote: Quote: Quote:
>>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" <SLH@SLH.SLHwrote in message
news:%237XiHbj5GHA.1248@TK2MSFTNGP03.phx.gbl... Quote:
>>
>"Justin Piper" <jpiper@bizco.comwrote in message
>news:op.tgsu4tyecs3d1w@luxembourg.psg.bizcotech.c om... Quote:
On Fri, 29 Sep 2006 19:53:41 -0500, Bob Lehmann
<nospam@dontbotherme.zzz> Quote: Quote:
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 Quote:
>or database anyway. so why worry about displaying it properly?
>>
>>
>>
>
>
| | | | re: question about wrapping a string
Bob Lehmann wrote: Quote: Quote: Quote:
>>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. | | | | re: question about wrapping a string
SLH wrote: Quote:
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. | | | | re: question about wrapping a string
i have long since implemented a function that rejects text that i determine
to be invalid
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:ecoEgev5GHA.4604@TK2MSFTNGP03.phx.gbl... Quote:
SLH wrote: Quote:
>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.
>
>
|  | Similar ASP / Active Server Pages bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|