Marcin Dobrucki wrote:
Brad Kent wrote:
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?
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
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.