John D. Pearson, Compuserve 72377,2540
April 8, 1991
This utility solves the peculiar problem we had of equalizing the
columns in a large full size table after we had adjusted them in the
course of normal editing. Our application generates a number of
tables for publication, each one page and roughly 35k in size, handled
as separate files. All of the tables had to be full page, with no
shading and after editing we wanted most of the columns to have equal
WP 5.1's normal table edit feature does not allow a very elegant way
of tidying up the result of normal table edits for full size tables.
It would be very useful to be able to lock the width of several
columns and equalize the width of the others, (which suggests two
possible extras for the table edit feature). WP will define a table
with equal widths, and it will allow one to set the width of each
column. In principle one could calculate the desired width and go
through and reset them every time for 15 tables, every quarter.
After driving my secretary batty, we managed to produce these tables
with 17 columns and get them to look ok. The header of one is given
as an example table.wp and as can be seen the columns vary in width
quite a lot although they fit the margins. I wrote this utility
EQUALIZE to process each file and make the columns other than the stub
have equal width.
Typing EQUALIZE will produce simple instructions. There are no
options other than these settings. Here are some examples.
equalize inputfile outputfile
-- sets all the column widths equal to meet the table margins.
equalize inputfile outputfile *
-- leaves the first column width as is, but resets all others so that
the sum equals the margins.
equalize inputfile,outputfile *,,,*,0.35
-- leaves column widths 1 and 4 unchanged and sets column 5 to 0.35"
width. All other columns are set to equal width so that the table
fits the margins.
The files must be less than 64 k bytes long. The code is attached for
further work if anyone is interested. This version looks for other
tables in the file but assumes they all need the same adjustment.