[l2h] multicolumn problem

Ross Moore ross at ics.mq.edu.au
Tue Mar 22 23:04:21 CET 2005


Hello Martin,

On 23/03/2005, at 5:01 AM, Martin Mrazek wrote:

> Hello,
> I have the tabular like
>
> \begin{tabular}{|l| r@{.}l| r@{.}l|}
> \hline
> ahoj & \multicolumn{2}{|c|}{nazdar} & \multicolumn{2}{|c|}{cau} \\
> martin &  2&3   & 3&2 \\
> \hline
> \end{tabular}
>
> when translated to HTML, the result is
>
> <P>
> <TABLE CELLPADDING=3 BORDER="1">
> <TR><TD ALIGN="LEFT">ahoj</TD>
> <TD ALIGN="CENTER" COLSPAN=2>nazdar</TD>
> <TD ALIGN="CENTER" COLSPAN=2>cau</TD>
> <TD ALIGN="LEFT">.</TD><TD ALIGN="LEFT">&nbsp;</TD>
> </TR>
> <TR><TD ALIGN="LEFT">martin</TD>
> <TD ALIGN="RIGHT">2</TD>
> <TD ALIGN="LEFT">.</TD><TD ALIGN="LEFT">3</TD>
> <TD ALIGN="RIGHT">3</TD>
> <TD ALIGN="LEFT">.</TD><TD ALIGN="LEFT">2</TD>
> </TR>
> </TABLE>
>
> what means  one number is separated into 3 columns. For example | 2|
> .  | 3| instead of 2.3
>
> Can you advice please, how to fix it?

This looks like you are trying to build the visual
effect of a single column of numbers
   2.3
   3.2
     etc,
by in fact using 2 columns juxtaposed, separated
by a constant '.' between those columns.

Sorry, there's no way LaTeX2HTML can work out that
that is what you are trying to do.

HTML is for laying-out information in a clear, regular way
so that it's meaning is retained and easily extracted.
If you really do mean 2.3  instead of having three separate
items of  2 & '.' & 3 , then that is how you should construct
the {tabular}.

The HTML language is not a page-description language, like TeX.
So you can never expect such trickery using @{..} sequences
to give you a satisfactory result.


My best advice for you is to include two separate {tabular}
environments, within "conditional" environments:


\usepackage{html}   %  you should *always* load this for LaTeX2HTML


%begin{latexonly}
  \begin{tabular}{|l| r@{.}l| r@{.}l|}
   \hline
   ahoj & \multicolumn{2}{|c|}{nazdar} & \multicolumn{2}{|c|}{cau} \\
   martin &  2&3   & 3&2 \\
   \hline
  \end{tabular}
%end{latexonly}
%
\begin{htmlonly}
  \begin{tabular}{|l|c|c|}
   \hline
   ahoj & nazdar & cau \\
   martin & 2.3  & 3.2 \\
   \hline
  \end{tabular}
\end{htmlonly}

Now you will get you prettily constructed version in LaTeX,
and a proper logically constructed version in HTML.



>
> MM

Hope this helps,

	Ross Moore

>
> _______________________________________________
> latex2html mailing list
> latex2html at tug.org
> http://tug.org/mailman/listinfo/latex2html
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the latex2html mailing list