creating "newspaper column" output

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

    creating "newspaper column" output

    Anyone out there have any tricks or scripts to take some text of
    unknown length and display it in two (or more) columns of equal
    height?
    The text may or may not contain "hard-coded" linebreaks or other
    formatting such as [UL]s.

    why there's not a columns tag in HTML is mystery
    <COLUMNS col=3>
    wouldn't this be grand
    </COLUMNS>
  • Michael Austin

    #2
    Re: creating &quot;newspa per column&quot; output

    Brad Kent wrote:
    [color=blue]
    > Anyone out there have any tricks or scripts to take some text of
    > unknown length and display it in two (or more) columns of equal
    > height?
    > The text may or may not contain "hard-coded" linebreaks or other
    > formatting such as [UL]s.
    >
    > why there's not a columns tag in HTML is mystery
    > <COLUMNS col=3>
    > wouldn't this be grand
    > </COLUMNS>[/color]

    What's wrong with a table -- you CAN predetermine it's height and width.

    <table> <tr> <td>text</td><td>second col</td> </tr></table>

    Michael.

    Comment

    • CJ Llewellyn

      #3
      Re: creating &quot;newspa per column&quot; output

      "Brad Kent" <bkfake-google@yahoo.co m> wrote in message
      news:7ad3d45b.0 406220656.27021 95b@posting.goo gle.com...[color=blue]
      > Anyone out there have any tricks or scripts to take some text of
      > unknown length and display it in two (or more) columns of equal
      > height?
      > The text may or may not contain "hard-coded" linebreaks or other
      > formatting such as [UL]s.[/color]

      Ouch!

      Why not force the author to break down the text into the relevant columns by
      placing two text boxes on the the entry screen and allowing them to preview
      the result?


      Comment

      • Chung Leong

        #4
        Re: creating &quot;newspa per column&quot; output

        "Brad Kent" <bkfake-google@yahoo.co m> wrote in message
        news:7ad3d45b.0 406220656.27021 95b@posting.goo gle.com...[color=blue]
        > Anyone out there have any tricks or scripts to take some text of
        > unknown length and display it in two (or more) columns of equal
        > height?
        > The text may or may not contain "hard-coded" linebreaks or other
        > formatting such as [UL]s.
        >
        > why there's not a columns tag in HTML is mystery
        > <COLUMNS col=3>
        > wouldn't this be grand
        > </COLUMNS>[/color]

        Netscape 4 had the MULTICOL tag I think. There're also some CSS styles for
        spliting paragraphs into columns but I don't think current browsers support
        them.


        Comment

        • Nikolai Chuvakhin

          #5
          Re: creating &quot;newspa per column&quot; output

          bkfake-google@yahoo.co m (Brad Kent) wrote in message
          news:<7ad3d45b. 0406220656.2702 195b@posting.go ogle.com>...[color=blue]
          >
          > Anyone out there have any tricks or scripts to take some text of
          > unknown length and display it in two (or more) columns of equal
          > height?[/color]

          I humbly suggest, forget it. You can break the text into columns,
          but you will not be able to enforce the correct pagination in
          print. For example, you may have something like this:

          This is the first This ir the second
          column; it must be column; it must be
          read first before read after you read
          proceeding to the the first column.
          second column.

          And when you print it out, you can easily get:

          This is the first This ir the second
          column; it must be column; it must be
          ------------------ Page Break ------------------
          read first before read after you read
          proceeding to the the first column.
          second column.
          [color=blue]
          > why there's not a columns tag in HTML is mystery[/color]

          No mystery; it's hard to render correctly without knowing
          what the media is...

          Cheers,
          NC

          Comment

          • Marcin Dobrucki

            #6
            Re: creating &quot;newspa per column&quot; output

            Brad Kent wrote:[color=blue]
            > Anyone out there have any tricks or scripts to take some text of
            > unknown length and display it in two (or more) columns of equal
            > height?[/color]



            Although this is only an approximation. Closer approximations would
            probably require a bit of JavaScript magic to first determine the size
            of your window, and then compute the layout of text within that window.
            That's a bit of work...

            /Marcin

            Comment

            • Michael Austin

              #7
              Re: creating &quot;newspa per column&quot; output

              Marcin Dobrucki wrote:
              [color=blue]
              > Brad Kent wrote:
              >[color=green]
              >> Anyone out there have any tricks or scripts to take some text of
              >> unknown length and display it in two (or more) columns of equal
              >> height?[/color]
              >
              >
              > http://css.nu/examples/css-columns.html
              >
              > Although this is only an approximation. Closer approximations would
              > probably require a bit of JavaScript magic to first determine the size
              > of your window, and then compute the layout of text within that window.
              > That's a bit of work...
              >
              > /Marcin[/color]



              Are you trying to do this dynamically as they type? or just displayed
              after-the fact?

              After-the-fact:

              If the "columns" will NEVER contain anything but text:
              $inputtext is used to store the text in question.
              and for this exercise $inputtext is 630 characters
              let's say Col1/Col2 size is 500 characters
              So, we locate character 500 and in reverse search for the last space
              character. and for argument sake, the last space character is at 496.

              (or another way is to add each word to an array as long as it is < 500
              characters. etc...)

              Col1(type is wrapped text) = character 1-496
              Col2 (type is wrapped text)= the first character after the last space
              through character 630.

              now place them in the proper columns in a table row.

              The thing I don't like about using browser version specific extensions
              and code is that it forces one to use the browser that only works with
              this particular site. I like the browser I use, but sometimes I am
              forced to you IE due to this coding mindset that "EVERYONE uses brandX".

              .... Yes, I could write the code, but I leave it as a learning exercise
              for you to learn...

              Michael Austin.

              Comment

              Working...