I think that, if you are able to import your html tables in Excel or OpenOffice Calc, these tools are what you need:
The first one is a macro you add to your Excel, and provides you with an extra button to create the LaTeX code for the table from a set of selected cells, ready to be pasted in your .tex source.
The second, is an extension of OO, but should work in the same way.
Edit: there is also html2LaTeX, but I never used it.
Happy TeXing!
Often, I have the use-case that I want to convert a given data table into a "suitable" LaTeX table.
Typically, my data is of numeric type and requires number formatting, perhaps alignment at a decimal point, and in most cases, it requires elementary post-processing (like quotients, differences, gradients).
Since I needed such stuff very often, I wrote some C++ scripts which generated .tex files. It was useful - but I realized very early that it is insufficient; it is just not flexible enough and -as any external tool- produces unwanted complications due to the many tools involved.
My solution is the LaTeX package pgfplotstable. It is a LaTeX table generator, i.e. it converts input data explicitly by a set of configurable rules into something like \begin{tabular}....\end{tabular}
.
DISCLAIMER NOTE: I wrote the package.
Among its features are
- separation of data + format
- data in form of external data files (CSV with customizable separators) or inline tables (inside of the
.tex
file)
- central format definition (for example in the preamble or in form of styles)
- format numbers with the full power of LaTeX
- supports simple text columns as well
- simple support for alternating row colors (
colortbl
)
- simple support for standart LaTeX table packages (
booktabs
, longtable
, colortbl
, multirow
, \multicolumn
,...)
- can produce completely new columns containing postprocessed data, with the powerful
pgf
math engine
- can convert single-column output to two-column output
- is written completely in TeX (no external tools required)
- highly customizable
- has a manual with lots of examples.
You may want to inspect the link mentioned above and its examples to see if it fits your needs.
Best Answer
Excel supports merged cells, and you can convert a table to LaTeX using the Excel2LaTeX add-in (this works for multirow and multicolumn cells). However, you would have to manually change the generated code if you want to use the
tabularx
environment.See also: Comprehensive list of tools that simplify the generation of LaTeX tables.