tabulka s promennou sirkou sloupcu
Davidek Tomas
davidek at hp02.troja.mff.cuni.cz
Mon Oct 18 11:05:04 CEST 1999
On Mon, 18 Oct 1999, Josef Svoboda wrote:
>
> \documentstyle{article}
> \begin{document}
>
> \def\tr#1{\hbox to\hsize{\strut\vrule#1}\hrule}
> % vytvorime box pres celou sirku radku
> %
> \def\td#1{\hfil\hbox to 0pt{\hss#1\hss}\hfil\vrule}
> % do radku vlozime pruzne vyplnky
> % | hfil [] hfil | hfil [] hfil | hfil [] hfil |
> % a mezi kazde dva vlozime box o nulove sirce;
> % z tohoto boxu bude na obe strany rovnomerne "precnivat")
> % text polozky
>
> \hrule
> \tr{\td{1}\td{2}\td{3}}
> \tr{\td{1111111111}\td{2}\td{3}}
> \tr{\td{0}\td{1}}
> \tr{\td{0}\td{11111111}}
> \tr{\td{999999}}
>
> \end{document}
Diky za radu. Ja jsem to mezitim vyresil s pomoci prostredi
tabularx (package tabularx.sty), ktere nabizi moznost roztahnout nektere
sloupce tabulky. Reseni pak vypada takto:
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcolumntype{K}{>{\centering\arraybackslash}p{0.6in}}
\begin{table}[htbp]
\begin{center}
\setlength{\extrarowheight}{2pt}
\begin{tabularx}{0.9\linewidth}{|K||Y|Y|Y|K|}
\hline
Tile row & \multicolumn{4}{c|}{\npe $[\mbox{GeV}^{-1}]$ in the
respective cell}\\
\hline\hline
11 & 48. & 49. & 49. & 40. \\
10 & 50. & 53. & 54. & 39. \\
\end{tabularx}
\begin{tabularx}{0.9\linewidth}{|K||Y|Y|Y|Y|Y|Y|Y|Y|}
\hline
9 & 45. & 46. & 45. & 44. & 43. & 45. & -- & 45. \\
8 & 47. & 47. & 43. & 42. & 44. & 42. & -- & 42. \\
7 & 48. & 48. & 45. & 42. & 43. & 49. & -- & 41. \\
\end{tabularx}
\end{center}
\end{table}
Zdravi
Tomas Davidek
E-mail : davidek at hp01.troja.mff.cuni.cz,
Tomas.Davidek at cern.ch
More information about the csTeX
mailing list