breaking lines with keeping crlf and spaces ?

Discussion in 'HTML' started by Davor, Jan 2, 2005.

  1. Davor

    Davor Guest

    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
     
    Davor, Jan 2, 2005
    #1
    1. Advertising

  2. Davor

    Neal Guest

    On Sun, 2 Jan 2005 23:42:09 +0100, 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 ?


    Sounds like you are describing pre. What does pre not offer you?
     
    Neal, Jan 2, 2005
    #2
    1. Advertising

  3. Davor

    Lunchbox G4 Guest

    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
     
    Lunchbox G4, Jan 3, 2005
    #3
  4. Davor

    Toby Inkster Guest

    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:-o-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
     
    Toby Inkster, Jan 3, 2005
    #4
  5. Davor

    Davor Guest

    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" <> wrote in message
    news:p...
    > 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:-o-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
    >
     
    Davor, Jan 3, 2005
    #5
  6. Davor

    Davor Guest

    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" <> wrote in message
    news:1104731272.01367b569830592d697be52065333e47@teranews...
    > 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
     
    Davor, Jan 3, 2005
    #6
  7. Davor

    Davor Guest

    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" <> wrote in message
    news:eek:...
    > On Sun, 2 Jan 2005 23:42:09 +0100, 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 ?

    >
    > Sounds like you are describing pre. What does pre not offer you?
     
    Davor, Jan 3, 2005
    #7
  8. Because it's so natural and computers do it!
    Why do people write the answer before the question?

    "Davor" <> 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
     
    Jukka K. Korpela, Jan 4, 2005
    #8
  9. Davor

    Davor Guest

    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" <> 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" <> 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
    >
    >
     
    Davor, Jan 4, 2005
    #9
  10. Davor

    Davor Guest

    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" <> wrote in message
    news:cretf5$98l$...
    > 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" <> 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" <> 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
    >>
    >>

    >
    >
     
    Davor, Jan 4, 2005
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amy
    Replies:
    0
    Views:
    511
  2. fd
    Replies:
    2
    Views:
    1,196
    Mark Day
    Mar 5, 2004
  3. johkar
    Replies:
    2
    Views:
    2,902
    Mayeul
    Dec 10, 2009
  4. Neil8Ken

    Non-breaking Spaces Added to Markup

    Neil8Ken, Apr 23, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    753
    Neil8Ken
    Apr 23, 2008
  5. Victor Hooi
    Replies:
    19
    Views:
    243
    Nick Mellor
    Dec 5, 2013
Loading...

Share This Page