2 @ col_rowspan_colors.roff
4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
7 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
9 This 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 2, or (at your option) any later
14 This 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 groff; see the file COPYING. If not, write to the Free
21 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
29 .defcolor c\\n# rgb \\*[#random]
35 .if \\n[t*cols\\n[t*#]]/2*2=\\n[t*cols\\n[t*#]] \{ .
36 . tmc \\n(.F:\\n(.c: cols was even (\\n[t*cols\\n[t*#]]),
37 . nr t*cols\\n[t*#] +1
38 . tm increased by one col to \\n[t*cols\\n[t*#]].
40 . ie "\\*[tal]"r" .nr in\\n[t*#] -\\*[width]\" recalculate cell widths etc.
41 . el .if "\\*[tal]"c" .nr in\\n[t*#] -\\*[width]/2
43 .nr N \\n[t*cols\\n[t*#]]-1 \" N must be even
45 .ds html "".TR height=\\nW" ".TD bgc=c\\n#"
47 .while \\nN>=\\n+I \{ .
51 . ds html "".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
53 . as html " ".TD rowspan=\\nI bgc=c\\n#"
55 . as html " ".TR height=\\nW" ".TD rowspan=\\nI bgc=c\\n#"
57 . as html " \\*[help] ".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
63 .PN 10 Text before table.
65 .PN 8 Indented text before table.
67 .TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
68 .TBL border= cols=10 width=1c tal=c csp=0 cpd=0 \"cols must be odd
69 .CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
72 .PN 15 Text after table.
75 .\" 466MHz Celeron CPU, 384MB RAM
76 .\" WindowsXP/cygwin groff18.1: 4s
77 .\" WindowsXP/cygwin groff19.2: 7s
78 .\" Suse Linux 9.3 groff19.2: 1s