LaTex技巧二:如何搭配出好看的表格?

来源:互联网 发布:互联网下一个风口 知乎 编辑:程序博客网 时间:2024/04/27 15:50

There is a nice table for you . Enjoy it .

\usepackage[T1]{fontenc}\usepackage[skip=1ex]{caption}\usepackage{booktabs,tabularx}\usepackage{siunitx}\newcolumntype{C}{>{\centering\arraybackslash}X}\newcommand{\mcx}[2]{\multicolumn{#1}{>{\hsize=\dimexpr#1\hsize                                        + #1\tabcolsep + #1\tabcolsep\relax}C}{#2}}\newcommand{\mcone}[1]{\multicolumn{1}{C}{#1}}\begin{document}    \begin{table}\caption{\label{orgc39fb42}    Prevalence of Undernourishment estimated for India with different parameter estimates}\begin{tabularx}{\textwidth}{l                 S[table-format=1.3]                 S[table-format=1.3]                 S[table-format=2.0]                 S[table-format=2.0]                            }    \toprule        &               &               & \mcx{2}{Prev of Unment and met}       \\    \cmidrule(lr){4-5}Mean    & \mcone{CV}    & \mcone{Skew}  & \mcone{MPEX=1791} & \mcone{MPEX=2037} \\    \midrule2455    & 0.25          & 0.55          & 15                & 23                \\2455    & 0.294         & 0.528         & 18                & 26                \\2135    & 0.294         & 0.528         & 27                & 39                \\    \bottomrule\end{tabularx}    \end{table}\end{document}
阅读全文
1 0
原创粉丝点击