[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] Exact column widths in 'tbl'
From: |
Ted Harding |
Subject: |
[Groff] Exact column widths in 'tbl' |
Date: |
Wed, 10 Aug 2011 12:53:51 +0100 (BST) |
Greetings all!
This is a follow-up to Chriss Schaller's query yesterday,
and the subsequent replies. I have opened e new thread,
since it is a topic of general interest.
Of course the keyword w(...) in the table format line,
e.g.
.TS
tab(#);
l lw(3i) lw(1.25i).
[...]
.TE
specifies a *minimum* column width. So it will not do
for setting a maximum column width, especially where there
are long text blocks in some cells.
The following example shows how to do it in general. The
basis is that a ".ll" request in a text block sets a line
length and this will be reflected in the resulting column
width (unless something else, e.g. a long entry which is
not a text block, forces a wider column).
Put the following into a file temp.tr :
--8<--cut here--8<--------------------------------------------
.TS
tab(#);
| l | l | l |.
_
08/08/2011#T{
.ll 3i
This is quite a long paragraph of text specially composed
for yesterday's date.
The purpose is to see what happens to it in a 3-inch
column width.
T}#T{
.ll 1.25i
And this is some silly stuff to fill column 3,
1.25 inches wide.
T}
09/08/2011//12:15#T{
.ll 3i
And this is another long paragraph specially composed
to suit the particular circumstances that apply at this moment
of this date.
T}#T{
.ll 1.25i
And this is more silly stuff to fill column 3,
still 1.25 inches wide.
T}
_
.TE
.sp 0.5m
Finally, we follow up with a lot of text outside the table
just to show that the per-column settings of \f[CB].ll\fP
in the above table have not affected the general ambient
line-length outside the table.
--8<--cut here--8<--------------------------------------------
Then execute
groff -t temp.tr > temp.ps
and view the resulting PostScript file temp.ps
Further comments welcome!
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 10-Aug-11 Time: 12:53:48
------------------------------ XFMail ------------------------------
- [Groff] Exact column widths in 'tbl',
Ted Harding <=