Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / groff / contrib / hdtbl / examples / col_rowspan_colors.roff
1 .\" -*- mode: roff -*-
2 .ig
3
4 col_rowspan_colors.roff
5
6 This file is part of groff, the GNU roff type-setting system.
7
8 Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
9 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
10
11 groff is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 groff is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
23
24 ..
25 .
26 .time start
27 .de color#
28 .nr # +1
29 .random#
30 .defcolor c\\n# rgb \\*[#random]
31 ..
32 .
33 .de brt
34 .nr # 0
35 .color#
36 .if \\n[t*cols\\n[t*#]]/2*2=\\n[t*cols\\n[t*#]] \{ .
37 .   tmc \\n(.F:\\n(.c: cols was even (\\n[t*cols\\n[t*#]]), 
38 .   nr t*cols\\n[t*#] +1
39 .   tm  increased by one col to \\n[t*cols\\n[t*#]].
40 .   t*cl \\*[width]
41 .   ie "\\*[tal]"r" .nr in\\n[t*#] -\\*[width]\"    recalculate cell widths etc.
42 .   el .if "\\*[tal]"c" .nr in\\n[t*#] -\\*[width]/2
43 .\}
44 .nr N \\n[t*cols\\n[t*#]]-1             \"      N must be even
45 .nr W 1c\"\\*[width]
46 .ds html "".TR height=\\nW" ".TD bgc=c\\n#"
47 .nr I 0 2
48 .while \\nN>=\\n+I \{ .
49 .   ds help "\\*[html]
50 .   pops * help
51 .   color#
52 .   ds html "".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
53 .   color#
54 .   as html " ".TD rowspan=\\nI bgc=c\\n#" 
55 .   color#
56 .   as html " ".TR height=\\nW" ".TD rowspan=\\nI bgc=c\\n#"
57 .   color#
58 .   as html " \\*[help] ".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
59 .\}
60 .P1 \\*[html]
61 ..
62 .
63 .pv 1.2 1.2 "" x
64 .PN 10 Text before table.
65 .in 1c
66 .PN 8 Indented text before table.
67 *** *** ***
68 .TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
69 .TBL  border= cols=10 width=1c tal=c csp=0 cpd=0 \"cols must be odd
70 .CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
71 .brt
72 .ETB .ETB 
73 .PN 15 Text after table.
74 .time
75 .date
76 .\"     466MHz Celeron CPU, 384MB RAM 
77 .\"     WindowsXP/cygwin groff18.1:      4s
78 .\"     WindowsXP/cygwin groff19.2:      7s
79 .\"     Suse Linux 9.3 groff19.2:        1s