Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > breaking lines with keeping crlf and spaces ?

Reply
Thread Tools

breaking lines with keeping crlf and spaces ?

 
 
Davor
Guest
Posts: n/a
 
      01-02-2005
is it possible with html or css to break text lines inside <td> tag, keeping
crlf-s, spaces and tabs ? Something like line break "stronger" than <pre>
tag ?

thx, Davor



 
Reply With Quote
 
 
 
 
Neal
Guest
Posts: n/a
 
      01-02-2005
On Sun, 2 Jan 2005 23:42:09 +0100, Davor <(E-Mail Removed)>
wrote:

> is it possible with html or css to break text lines inside <td> tag,
> keeping
> crlf-s, spaces and tabs ? Something like line break "stronger" than <pre>
> tag ?


Sounds like you are describing pre. What does pre not offer you?
 
Reply With Quote
 
 
 
 
Lunchbox G4
Guest
Posts: n/a
 
      01-03-2005
Davor wrote:
> is it possible with html or css to break text lines inside <td> tag, keeping
> crlf-s, spaces and tabs ? Something like line break "stronger" than <pre>
> tag ?
>
> thx, Davor
>
>
>


Will <br> not work?

//LBG4
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      01-03-2005
Davor wrote:

> is it possible with html or css to break text lines inside <td> tag, keeping
> crlf-s, spaces and tabs ?


Sounds like you need:

td {
white-space: pre-wrap;
}

It's part of CSS 2.1, but only supported by Opera 7.5+.

In Opera 4.x-6.x you can use "white-space:-pre-wrap" and in Opera 7.0x-7.2x
you can use "white-space-pre-wrap". Mozilla and other Geckos have
"white-space:-moz-pre-wrap".

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Davor
Guest
Posts: n/a
 
      01-03-2005
Yes, I think that might be it, but my users are on IE 6.....

Davor

--
CRO-pack add-in za MS Excel :
http://www.inet.hr/~dbevandi
"Toby Inkster" <(E-Mail Removed)> wrote in message
news(E-Mail Removed) k...
> Davor wrote:
>
>> is it possible with html or css to break text lines inside <td> tag,
>> keeping
>> crlf-s, spaces and tabs ?

>
> Sounds like you need:
>
> td {
> white-space: pre-wrap;
> }
>
> It's part of CSS 2.1, but only supported by Opera 7.5+.
>
> In Opera 4.x-6.x you can use "white-space:-pre-wrap" and in Opera
> 7.0x-7.2x
> you can use "white-space-pre-wrap". Mozilla and other Geckos have
> "white-space:-moz-pre-wrap".
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact
>



 
Reply With Quote
 
Davor
Guest
Posts: n/a
 
      01-03-2005
No, I don't prepare text myself, its from MS Access database, and it's
created by different users. Text is edited in textarea box which
automatically breaks lines without crlf-s. I know I could count letters and
insert crlf-s in ASP or Java Script, but I would like to break text lines in
table depending on window size, sizing table columns in percents.

Davor



"Lunchbox G4" <(E-Mail Removed)> wrote in message
news:1104731272.01367b569830592d697be52065333e47@t eranews...
> Davor wrote:
>> is it possible with html or css to break text lines inside <td> tag,
>> keeping crlf-s, spaces and tabs ? Something like line break "stronger"
>> than <pre> tag ?
>>
>> thx, Davor
>>
>>
>>

>
> Will <br> not work?
>
> //LBG4



 
Reply With Quote
 
Davor
Guest
Posts: n/a
 
      01-03-2005
No, it's not like pre. Text is inserted in textarea and saved in database
and it's in one long line whereever the line is broken by textarea
automatically. But I stil want to keep users entered crlf-s and multiple
spaces.

Davor

"Neal" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Sun, 2 Jan 2005 23:42:09 +0100, Davor <(E-Mail Removed)>
> wrote:
>
>> is it possible with html or css to break text lines inside <td> tag,
>> keeping
>> crlf-s, spaces and tabs ? Something like line break "stronger" than <pre>
>> tag ?

>
> Sounds like you are describing pre. What does pre not offer you?



 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-04-2005
Because it's so natural and computers do it!
Why do people write the answer before the question?

"Davor" <(E-Mail Removed)> wrote:

> No, it's not like pre. Text is inserted in textarea and saved in
> database and it's in one long line whereever the line is broken by
> textarea automatically. But I stil want to keep users entered
> crlf-s and multiple spaces.


You should have explained that in the original question. It changes the
whole issue.

In processing user input from textarea, you can't assume much, since
browsers behave in different ways
(see http://www.cs.tut.fi/~jkorpela/forms/textarea.html ).

You _do_ get spaces as entered by the user. What you do then depends on
the context. If the data is echoed to a user in an HTML document, then
the <pre> element takes care of preserving spaces. Replacing spaces by
&nbsp; generally works, though it's really a hack and not guaranteed to
work.

Line breaks are a different beast. You might be unable to distinguish
user-entered line breaks from browser-generated line breaks ("hard
wrapping"), and more seriously you cannot know whether the user
actually _meant_ to break a line but didn't - because he saw the
browser wrap the text and thought that's OK (without realizing that the
line break will probably not be transmitted).

What you really need now is an analysis of what you are doing with the
user data and why.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Davor
Guest
Posts: n/a
 
      01-04-2005
Thanx, that should do the trick... I've tried to break lines on table column
width, but this is even better because now I have wyswyg from user.

Davor


"Jukka K. Korpela" <(E-Mail Removed)> wrote in message
news:Xns95D419C942F0jkorpelacstutfi@193.229.0.31.. .
> Because it's so natural and computers do it!
> Why do people write the answer before the question?
>
> "Davor" <(E-Mail Removed)> wrote:
>
>> No, it's not like pre. Text is inserted in textarea and saved in
>> database and it's in one long line whereever the line is broken by
>> textarea automatically. But I stil want to keep users entered
>> crlf-s and multiple spaces.

>
> You should have explained that in the original question. It changes the
> whole issue.
>
> In processing user input from textarea, you can't assume much, since
> browsers behave in different ways
> (see http://www.cs.tut.fi/~jkorpela/forms/textarea.html ).
>
> You _do_ get spaces as entered by the user. What you do then depends on
> the context. If the data is echoed to a user in an HTML document, then
> the <pre> element takes care of preserving spaces. Replacing spaces by
> &nbsp; generally works, though it's really a hack and not guaranteed to
> work.
>
> Line breaks are a different beast. You might be unable to distinguish
> user-entered line breaks from browser-generated line breaks ("hard
> wrapping"), and more seriously you cannot know whether the user
> actually _meant_ to break a line but didn't - because he saw the
> browser wrap the text and thought that's OK (without realizing that the
> line break will probably not be transmitted).
>
> What you really need now is an analysis of what you are doing with the
> user data and why.
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>
>



 
Reply With Quote
 
Davor
Guest
Posts: n/a
 
      01-04-2005
Just one more question. Is it possible to get similar behaviour from MS
Access text box, or should I insert crlf-s in VBA ?

Davor


"Davor" <(E-Mail Removed)> wrote in message
news:cretf5$98l$(E-Mail Removed)...
> Thanx, that should do the trick... I've tried to break lines on table
> column width, but this is even better because now I have wyswyg from user.
>
> Davor
>
>
> "Jukka K. Korpela" <(E-Mail Removed)> wrote in message
> news:Xns95D419C942F0jkorpelacstutfi@193.229.0.31.. .
>> Because it's so natural and computers do it!
>> Why do people write the answer before the question?
>>
>> "Davor" <(E-Mail Removed)> wrote:
>>
>>> No, it's not like pre. Text is inserted in textarea and saved in
>>> database and it's in one long line whereever the line is broken by
>>> textarea automatically. But I stil want to keep users entered
>>> crlf-s and multiple spaces.

>>
>> You should have explained that in the original question. It changes the
>> whole issue.
>>
>> In processing user input from textarea, you can't assume much, since
>> browsers behave in different ways
>> (see http://www.cs.tut.fi/~jkorpela/forms/textarea.html ).
>>
>> You _do_ get spaces as entered by the user. What you do then depends on
>> the context. If the data is echoed to a user in an HTML document, then
>> the <pre> element takes care of preserving spaces. Replacing spaces by
>> &nbsp; generally works, though it's really a hack and not guaranteed to
>> work.
>>
>> Line breaks are a different beast. You might be unable to distinguish
>> user-entered line breaks from browser-generated line breaks ("hard
>> wrapping"), and more seriously you cannot know whether the user
>> actually _meant_ to break a line but didn't - because he saw the
>> browser wrap the text and thought that's OK (without realizing that the
>> line break will probably not be transmitted).
>>
>> What you really need now is an analysis of what you are doing with the
>> user data and why.
>>
>> --
>> Yucca, http://www.cs.tut.fi/~jkorpela/
>> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSD to allow A-Z 0-9 and spaces, but not leading/trailing spaces johkar XML 2 12-10-2009 09:24 AM
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM
Non-breaking Spaces Added to Markup Neil8Ken ASP .Net Building Controls 0 04-23-2008 10:35 PM
Looking for a breaking news rss feed that really contains breaking news Amy XML 0 02-22-2005 06:31 PM



Advertisments