Adding "soft-hyphen"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    Adding "soft-hyphen"

    My PHP script builds a table that is too wide to fit on the paper. Two
    of the columns contain strings that are more lengthy than data in the
    other columns.

    I can get the table to fit by letting the browser break the lengthy
    strings across two or more lines, thus allowing the column to get
    skinnier. I do this by inserting spaces in various places in the
    string. But this is not a desirable solution as it would mislead the
    user into thinking the string contains spaces when it doesn't.

    Is there an invisible character code I can insert into the string that
    tells the browser that it is allowed to line-wrap the string at this
    place, if needed? Popular word processors have a feature like this
    called "soft hyphens" or "soft breaks", etc.

    Mark
  • Terry

    #2
    Re: Adding "soft-hyphen"

    Mark wrote:[color=blue]
    > My PHP script builds a table that is too wide to fit on the paper. Two
    > of the columns contain strings that are more lengthy than data in the
    > other columns.
    >
    > I can get the table to fit by letting the browser break the lengthy
    > strings across two or more lines, thus allowing the column to get
    > skinnier. I do this by inserting spaces in various places in the
    > string. But this is not a desirable solution as it would mislead the
    > user into thinking the string contains spaces when it doesn't.
    >
    > Is there an invisible character code I can insert into the string that
    > tells the browser that it is allowed to line-wrap the string at this
    > place, if needed? Popular word processors have a feature like this
    > called "soft hyphens" or "soft breaks", etc.[/color]

    You must have something in your html/css that is preventing line wrap.
    Default is for table text to wrap. Also check the way you have defined
    table width - 90% will force the table to fit in the view size.

    --
    TK
    Friendly and helpful customer support that goes above and beyond. We help you get the perfect domain name.

    Still Having a Ball


    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet?







    ..

    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

    Comment

    • Mark

      #3
      Re: Adding "soft-hyphen"

      Terry wrote:[color=blue]
      >
      > You must have something in your html/css that is preventing line wrap.
      > Default is for table text to wrap. Also check the way you have defined
      > table width - 90% will force the table to fit in the view size.
      >[/color]
      In Firefox, at least, text in cells will not be wrapped unless there is
      a break point, such as whitespace. If a have long text without
      whitespace in a column, such as a URL, Firefox will stretch the width of
      the column to the minimum necessary to show the full string without a
      line-wrap. I don't know if this is the case with IE, yet, as I am not
      in a location that I have access to the password-protected page in question.

      Mark

      Comment

      • Sandman

        #4
        Re: Adding "soft-hyphen"

        In article <dg3rlb$qfn$1@n ews.nems.noaa.g ov>, Mark <Mark.Fenbers@n oaa.gov>
        wrote:
        [color=blue]
        > My PHP script builds a table that is too wide to fit on the paper. Two
        > of the columns contain strings that are more lengthy than data in the
        > other columns.
        >
        > I can get the table to fit by letting the browser break the lengthy
        > strings across two or more lines, thus allowing the column to get
        > skinnier. I do this by inserting spaces in various places in the
        > string. But this is not a desirable solution as it would mislead the
        > user into thinking the string contains spaces when it doesn't.
        >
        > Is there an invisible character code I can insert into the string that
        > tells the browser that it is allowed to line-wrap the string at this
        > place, if needed? Popular word processors have a feature like this
        > called "soft hyphens" or "soft breaks", etc.[/color]

        Well, as far as I know, there is no way to tell the browser to linewrap a long
        string to a certain width, only when the string is divided into words, but not
        a consecutive string of characters.

        A solution could be to put the long field on a row of its own, spanning the
        width of the other values.

        If the field values are:

        1. Foo
        2. Bar
        3. Donkey
        4. Monkey
        5. VeryLongStringT hatMessesUpWidt h

        And the table looks like this in crappy ASCII art:

        +------+------+---------+---------+---------------------------------+
        | Foo | Bar | Monkey | Donkey | VeryLongStringT hatMessesUpWidt h |
        +------+------+---------+---------+---------------------------------+

        And field 5 is the same for all lines in the report, you could divide it like
        this:

        <tr>
        <td>Foo</td>
        <td>Bar</td>
        <td>Donkey</td>
        <td>Monkey</td>
        </tr>
        <tr>
        <td colspan='4'>Ver yLongStringThat MessesUpWidth</td>
        </tr>

        Which, in crappy ASCII art would look like this:

        +------+------+---------+---------+
        | Foo | Bar | Monkey | Donkey |
        +------+------+---------+---------+
        | VeryLongStringT hatMessesUpWidt h |
        +---------------------------------+

        Set style="backgrou nd-color: #CCC" on the first <tr> to make them be dividers
        for each long value.

        Hope this helped.





        --
        Sandman[.net]

        Comment

        • Andy Hassall

          #5
          Re: Adding &quot;soft-hyphen&quot;

          On Mon, 12 Sep 2005 08:03:21 -0400, Mark <Mark.Fenbers@n oaa.gov> wrote:
          [color=blue]
          >My PHP script builds a table that is too wide to fit on the paper. Two
          >of the columns contain strings that are more lengthy than data in the
          >other columns.
          >
          >I can get the table to fit by letting the browser break the lengthy
          >strings across two or more lines, thus allowing the column to get
          >skinnier. I do this by inserting spaces in various places in the
          >string. But this is not a desirable solution as it would mislead the
          >user into thinking the string contains spaces when it doesn't.
          >
          >Is there an invisible character code I can insert into the string that
          >tells the browser that it is allowed to line-wrap the string at this
          >place, if needed? Popular word processors have a feature like this
          >called "soft hyphens" or "soft breaks", etc.[/color]

          Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
          discussion of the HTML equivalent.

          --
          Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
          http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

          Comment

          • Mark

            #6
            Re: Adding &quot;soft-hyphen&quot;

            Andy Hassall wrote:[color=blue]
            >
            > Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
            > discussion of the HTML equivalent.[/color]

            Actually, It was Jukka Korpela who pointed out in another post that I
            could use the <wbr> tag to indicate a permissible place for a line
            break. This is used inside <nobr> tags, which seems counter-intuitive
            at first, but it gives you control as to exactly where you will permit a
            line break and nowhere else...

            I've already tried it, and <wbr> works well for IE, but Firefox just
            ignores it.

            Mark

            Comment

            • Andy Hassall

              #7
              Re: Adding &quot;soft-hyphen&quot;

              On Mon, 12 Sep 2005 13:31:59 -0400, Mark <Mark.Fenbers@n oaa.gov> wrote:
              [color=blue]
              >Andy Hassall wrote:[color=green]
              >>
              >> Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
              >> discussion of the HTML equivalent.[/color]
              >
              >Actually, It was Jukka Korpela who pointed out in another post that I
              >could use the <wbr> tag to indicate a permissible place for a line
              >break. This is used inside <nobr> tags, which seems counter-intuitive
              >at first, but it gives you control as to exactly where you will permit a
              >line break and nowhere else...
              >
              >I've already tried it, and <wbr> works well for IE, but Firefox just
              >ignores it.[/color]

              Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
              them.



              --
              Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
              http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

              Comment

              • Mark

                #8
                Re: Adding &quot;soft-hyphen&quot;

                >>[color=blue][color=green]
                >>I've already tried it, and <wbr> works well for IE, but Firefox just
                >>ignores it.[/color]
                >
                >
                > Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
                > them.
                >
                > http://www.w3.org/TR/html401/index/elements.html
                >[/color]

                It's _very_ unfortunate that neither Firefox or HTML 4.01 embrace this
                useful tag. Furthermore, Firefox also ignores the ­ or &#173; code
                which _IS_ part of the HTML 4 standard
                (http://www.w3.org/TR/html401/sgml/entities.html). Now I'm relegated to
                having to post a message that says something to the effect of... "For
                best results with a printed copy of this table, use Internet Explorer." :(

                Mark

                Comment

                • Andy Hassall

                  #9
                  Re: Adding &quot;soft-hyphen&quot;

                  On Mon, 12 Sep 2005 14:35:37 -0400, Mark <Mark.Fenbers@n oaa.gov> wrote:
                  [color=blue][color=green][color=darkred]
                  >>>I've already tried it, and <wbr> works well for IE, but Firefox just
                  >>>ignores it.[/color]
                  >>
                  >> Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
                  >> them.
                  >>
                  >> http://www.w3.org/TR/html401/index/elements.html[/color]
                  >
                  >It's _very_ unfortunate that neither Firefox or HTML 4.01 embrace this
                  >useful tag.[/color]

                  I think Firefox is correct in not supporting non-existent tags; nobody wants
                  the bad old days of <marquee><blink >made-up tags</blink></marquee> to be
                  encouraged.
                  [color=blue]
                  >Furthermore, Firefox also ignores the ­ or &#173; code
                  >which _IS_ part of the HTML 4 standard
                  >(http://www.w3.org/TR/html401/sgml/entities.html).[/color]

                  But here I strongly agree with you; Firefox's lack of support for the proper
                  way of doing discretionary hyphens is unfortunate.

                  There is a change request for this, though, which you may want to add your
                  vote to:



                  --
                  Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
                  http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

                  Comment

                  Working...