WeBWorK Main Forum

multirow in tabular?

Re: multirow in tabular?

by Alex Jordan -
Number of replies: 0
I added colspan=>integer capacity to niceTables.pl. As a byproduct, you can also declare halign=>string for a cell. halign is perhaps not the best name for what it does, but it's consistent with align=>string for the whole table (which is also a bad name, but anyway).

So you can do things like
DataTable([[1, 2, 3],
[4, [5,colspan=>2]]]);

And the halign string can be something simple like "r" or something complicated like "|>{\color{blue}\cellcolor{green}}r|". If you use colspan in a cell, you should probably also use halign for that cell and get specific.

In the same way that align for the whole table works, the bits of halign for a cell will be interpreted and applied for both hardcopy and screen output. Pipes, the actual alignment character (r, c, l, p{width}, or X), coloring, boldface, italics, and monospace all get applied to both output modes.

Right now this is sitting in a pull request to the develop branch of pg. If anyone is in more of a hurry, you can make a local macros copy of the file by following the pull request: https://github.com/openwebwork/pg/pull/233.

It remains to implement rowspan.