[l2h] table cell spanning multiple rows

Ross Moore ross at ics.mq.edu.au
Wed Feb 25 22:37:15 CET 2009

On 25/02/2009, at 7:51 PM, Lucio Chiappetti wrote:

> On Wed, 25 Feb 2009, Ross Moore wrote:
>> LaTeX2HTML does support a \multirow command, but the sytax is a  
>> little
>> different to what the {multirow} package uses.
> I haven't found a \multirow command in the version bundled with my  
> SuSE
> (doc labelled 99.1(beta)).

It's certainly in  2001+  versions, but I'm pretty
sure that I was using it well before then.


>> [GlenMorangie:share/lib/latex2html] rossmoor% pwd
>> /sw/share/lib/latex2html
>> [GlenMorangie:share/lib/latex2html] rossmoor% grep multirow  
>> versions/html3_2.pl
>>     # set a flag to indicate whether there are any \multirow cells
>>     my $has_multirow = 1 if (/\\multirow/s);
>>     local @row_spec = map {'0'} @colspec if $has_multirow;
>>         if ($has_multirow) {
>>             # skip this cell if it is covered by a \multirow
>>             next if ($has_multirow && @row_spec[$i] > 0);
>> sub do_cmd_multirow {

The same kind of coding is in  html4_2.pl as well.

The syntax is:

   \multirow{<num-rows>}{<width>}{<vert-align>}{... content ...}

multirows.sty  defines a syntax:

% \multirow{nrows}[bigstruts]{width}[fixup]{text}

which doesn't control alignments vertically.
If you want middle-alignment or bottom-alignment
you have to contrive this somehow within the {text}.

Also,  carlisle/blkarray.sty
   has a command  \BAmultirow  having just 2 arguments.

>> There are ways to do what you want...
>> [...] environments allow you to write documents that compile  
>> correctly
>> with different processing engines.
> I would consider that as a "last resort". I already have one case like
> that, for instance to handle the \sf font not recognised in HTML as
> <font face=sans-serif> ... but for the table it looks such a  
> solution is
> quite contrived.

Not at all.
It is perfectly normal to define a convenient syntax for
the data that you have, then map it to suit the syntax
provided by the implementation in a system-provided package.

Generally this means that you can hide parameters (in this
case column-widths, alignment-specifiers, etc.) that are
related to the layout of your data, rather than its meaning,
  within the \newenvironment  and  \newcommand definitions,
thereby making your document-body source more easily readable.

LaTeX2HTML gives you the means to do this, using
"conditional coding" constructions, completely
compatible with other TeX processing engines.

> I found however a much simpler way which works. Using "p" columns in
> tabular, and wrapping the multi-line column cell in a parbox. The
> following snippet works and gives the look I want both in PDF and  
> \begin{tabular}[t]{|l|p{10cm}|}\hline
> {\bf Language}     & {\bf Statements} \\\hline
> \Fortran
> & \parbox[t]{10cm}{\fortran{PROGRAM \textit{name}} \\
>    ...                             \\
>    \fortran{STOP}                  \\
>    \fortran{END} }                 \\\hline
> \Clang
> & placeholder                     \\
> \hline
> \end{tabular}
> -- 
> Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
> For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html

Hope this helps,


Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114

More information about the latex2html mailing list