473,949 Members | 22,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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">thi s 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 1757
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.publi c.inetserver.as p.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">thi s 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.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.publi c.inetserver.as p.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">thi s 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.publi c.inetserver.as p.general:
"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
>Joe Reynolds wrote on 28 Sep 2006 in
microsoft.publ ic.inetserver.a sp.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">thi s 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.t ranslation.

So please ask in news:comp.infos ystems.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.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.publi c.inetserver.as p.general:
>"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******* *************@1 94.109.133.242. ..
>>Joe Reynolds wrote on 28 Sep 2006 in
microsoft.pub lic.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">thi s 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.t ranslation.

So please ask in news:comp.infos ystems.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:250p x;". 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**********@s pammotel.comwro te in message
news:u%******** ********@TK2MSF TNGP05.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:250p x;". 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.leng th;
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.publi c.inetserver.as p.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.net wrote in message news:Xn******** ************@19 4.109.133.242.. .
Joe Reynolds wrote on 28 Sep 2006 in
microsoft.publi c.inetserver.as p.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

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

Similar topics

11
5622
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 squarely in the middle of that string will sorta word wrap. so why doesn't it seem to work with !'s? here's a page that demonstrates how !'s don't seem to word wrap: http://www.geocities.com/terra1024/wordwrap.htm here's a page that shows how...
44
4373
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 must be many know the answer here. thanks
16
2639
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 string is directly generated in the code. But it doesn't works if I wait for this inside a 'while' loop. This is the simple code: global stringZVEI
5
5306
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 specification for each column (e.g. printf(%10s %25s %15s\n", pszCol1, pszCol2, pszCol3)). My problem is that when a string is longer the column's width, it overflows the column and takes the table out of alignment. What I want it to do is word-wrap...
10
2351
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 too. #include "header.h" /* does the wordwrapping */ void fold(char buffer, int len) {
4
3345
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, how are you sure that your managed object resources are completely freed up of resources it's might be using? In my case below I have a private bool variable. Are there any other managed resource that you might need to explicitly free up in
25
1521
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 DOG Dim COLOUR As String Dim AGE As Integer Dim NAME As String
6
5191
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 whatever doesn't fit there to go on a third page, etc, so that I can piece together the final output by laying the pages side by side. Things that don't work well: 1) Breaking up the line into sections of a given # of characters. Problem with...
35
1950
by: rebeccatre | last post by:
hi can Variant archiving setTimout('.. capability be done without using it? :-)
0
10170
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9990
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11592
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11188
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9903
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8264
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6128
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4954
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3553
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.