473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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>
Jul 17 '05 #1
6 1826
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?
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>


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.
Jul 17 '05 #2
"Brad Kent" <bk***********@yahoo.com> wrote in message
news:7a**************************@posting.google.c om...
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.


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?
Jul 17 '05 #3
"Brad Kent" <bk***********@yahoo.com> wrote in message
news:7a**************************@posting.google.c om...
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>


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.
Jul 17 '05 #4
bk***********@yahoo.com (Brad Kent) wrote in message
news:<7a**************************@posting.google. com>...

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?
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.
why there's not a columns tag in HTML is mystery


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

Cheers,
NC
Jul 17 '05 #5
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
Jul 17 '05 #6
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.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
3
by: Ed L. | last post by:
On 7.4.6, is there any problem with defining one column of a view to be a string literal? For example ... $ psql -c "create view fooview as select 'bar' as footype" WARNING: column "footype"...
1
by: Sandro Daehler | last post by:
Hy i have a problem with the following statement: SELECT MAX(id) FROM apconfig; if i send this statement i got the following error: ERROR: column "id" does not exist
2
by: rusmo1 | last post by:
I have a GridvVew in which all of the columns are sortable. I want the first column to display the position of the row in the sorted order regardless of which column I've sorted or which direction...
3
by: TristaSD | last post by:
Hi, Trying to streamline my code to output a "SELECT ALL" query into multiple columns of the same table. Right now it's set to put values into certain columns based on the ID (INT, Autonumber)....
0
by: lgalumbres | last post by:
Hello, I have a DataGridView control with a DataGridViewComboBoxColumn that allows users to choose selections from a list. The DataGridView is bound to a DataTable object and the...
3
by: Vivek | last post by:
Hi, Can someone give an example of a query which produces the following warning: SQL0012W Correlation without qualification has occurred for the column "<column>".
1
by: Ducknut | last post by:
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.