[l2h] Tables

Marek Rouchal Marek Rouchal <marek@btfmd1.fs.uni-bayreuth.de>
Wed, 22 Dec 1999 19:27:47 +0100 (CET)


On Wed, 22 Dec 1999, Joerg Broeker wrote:

> Is there a reason, why simple tables look that bad if converted by
> latex2html ?

That depends on what you mean with "bad".

> Example:
> 
> A table with the latex code
> 
> \begin{tabular}{|c|c|c|} \hline
> Row1 & Large & Row3 \\ 
> & Row2 & \\ \hline
> \end{tabular}

(Note: This is a 2 rows x 3 columns table, right?)

> results in the HTML code
> 
> <TABLE CELLPADDING=3 BORDER="1" ALIGN="CENTER">
> <TR><TD ALIGN="CENTER">Row1</TD>
> <TD ALIGN="CENTER">Large</TD>
> <TD ALIGN="CENTER">Row3</TD>
> </TR>
> <TR><TD ALIGN="CENTER">&nbsp;</TD>
> <TD ALIGN="CENTER">Row2</TD>
> <TD ALIGN="CENTER">&nbsp;</TD>
> </TR>
> </TABLE>
> 
> But the code should rather look like
> 
> <TABLE CELLPADDING=3 BORDER="1" ALIGN="CENTER">
> <TR><TD ALIGN="CENTER">Row1</TD>
> <TD ALIGN="CENTER">Large<br>Row2</TD>
> <TD ALIGN="CENTER">Row3</TD>
> </TR>
> </TABLE>

No, because LaTeX2HTML translates the logic behind the LaTeX commands into
the logic of HTML, and in this case a HTML table with 2 rows and two
columns is produced.

> This produces a much better looking result and should be quite simple to
> implement, or did I miss something?

The look can be controlled by customized style sheets. There is no point
in "optimizing" the look at such a level. And it is definitely *not*
simple to implement!

Again, we're translating markup here, and that clearly says: "I want a
table with 3 columns and 2 rows". And this is what you'll get in HTML: Two
rows (<TR>) and 3 columns (<TD>).

Sorry if this answer sounds somewhat harsh, but a change like this would
mean a total disregard of LaTeX2HTML principles.

-Marek