2 col_rowspan_colors.roff
4 This file is part of groff, the GNU roff type-setting system.
6 Copyright (C) 2005-2018 Free Software Foundation, Inc.
7 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 groff is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 .so \*[sopath]examples/common.roff
28 .\" Seed the random number generator for reproducible builds.
29 .random-seed 131545532 19201711
33 .defcolor c\\n# rgb \\*[#random]
39 .if \\n[t*cols\\n[t*#]]/2*2=\\n[t*cols\\n[t*#]] \{ .
40 . tmc \\n(.F:\\n(.c: cols was even (\\n[t*cols\\n[t*#]]),
41 . nr t*cols\\n[t*#] +1
42 . tm1 " increased by one col to \\n[t*cols\\n[t*#]].
44 . ie "\\*[tal]"r" .nr in\\n[t*#] -\\*[width]\" recalculate cell widths etc.
45 . el .if "\\*[tal]"c" .nr in\\n[t*#] -\\*[width]/2
47 .nr N \\n[t*cols\\n[t*#]]-1 \" N must be even
49 .ds html "".TR height=\\nW" ".TD bgc=c\\n#"
51 .while \\nN>=\\n+I \{ .
55 . ds html "".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
57 . as html " ".TD rowspan=\\nI bgc=c\\n#"
59 . as html " ".TR height=\\nW" ".TD rowspan=\\nI bgc=c\\n#"
61 . as html " \\*[help] ".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
67 .PN 10 Text before table.
69 .PN 8 Indented text before table.
71 .TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
72 .TBL border= cols=11 width=1c tal=c csp=0 cpd=0 \"cols must be odd
73 .CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
76 .PN 15 Text after table.
78 .\" ====================================================================
80 .\" ====================================================================
86 .\" vim: set filetype=groff textwidth=72: