I tried to combine this answer Compile a LaTeX document into a PNG image that's as short as possible with my answer Add column in a multicolumn table
But the pdflatex -shell-escape table.tex ignores linebreaks and the 3 tables are horizontally aligned and not vertically.
table.tex
\documentclass[convert]{standalone}
% \documentclass{article}
\usepackage{booktabs} % for nice lines
\usepackage{siunitx} % nice numbers and units and 'S' in table
\usepackage{multirow} % enable \multirow command
\begin{document}
short answer to your question:\
\begin{tabular}{|c|c|S|}
\hline
Genre & Name & {Weight}\\hline
Humain & Aragorn & 102 \\hline
\multirow{4}{*}{Hobbit}&Frodon & 32.1\\cline{2-3}
&Sam & 3.2 \\cline{2-3}
&Peregrin & 2.232\\cline{2-3}
&Meriadoc & 23 \\hline
Elfe&Legolas & 34.5 \\hline
\end{tabular}\[1cm]
You can also use the power of booktabs and siunitx:\
\begin{tabular}[ht]{l c S} % alignment l = left, c = centre, S = at decimal - needs siunitx
\toprule
Genre&Name& {Weight}\ % protect non numbers with {} in S columns
\midrule
Elfe&Legolas & 34.5\
Dwarf&Peter & 103.31\
\bottomrule
\end{tabular}\[1cm]
And combine that with your table:\
\begin{tabular}{c c S}
\toprule
Genre & Name & {Weight}\\midrule
Humain & Aragorn & 102 \\midrule
\multirow{4}{*}{Hobbit}&Frodon & 32.1\\cline{2-3}
&Sam & 3.2 \\cline{2-3}
&Peregrin & 2.232\\cline{2-3}
&Meriadoc & 23 \\midrule
Elfe&Legolas & 34.5 \
\bottomrule
\end{tabular}
\end{document}




varwidthoption to the class. – egreg Nov 14 '12 at 18:36