如何在乳胶中绘制这样的表格

如何在乳胶中绘制这样的表格

在此处输入图片描述

你好,我想在 texstudio 中绘制一个表格。我是新手,有谁能帮我一下,该怎么做?

答案1

只需在第三列创建嵌套表格即可。可以使用一些宏稍微简化一下:

姆韦

\documentclass[11pt]{article}
\def\xxx#1#2{\begin{tabular}{|p{4em}|p{4em}|}\hline#1&#2\\\hline\end{tabular}}
\begin{document}
\begin{tabular}{|l|l|l|l|}
    foo & bah & Variability Process \\
    11 & 12 & \xxx{13}{14}\\\hline
    21 & 22 & \xxx{23}{24}\\\hline
    31 & 32 & \xxx{33}{34}\\\hline
\end{tabular}
\end{document}

话虽如此,考虑避免垂直规则并使用规则booktabs

\documentclass[11pt]{article}
\usepackage{booktabs}
\def\xxx#1#2{\begin{tabular}{|p{4em}|p{4em}|}\hline#1&#2\\\hline\end{tabular}}
\begin{document}
\begin{tabular}{llll}\toprule
    foo & bah & Variability Process \\\midrule
    11 & 12 & \xxx{13}{14}\\
    21 & 22 & \xxx{23}{24}\\
    31 & 32 & \xxx{33}{34}\\\bottomrule
\end{tabular}
\end{document}

mwe2

或更好:

MWE3

\documentclass[11pt]{article}
\usepackage[table]{xcolor}
\usepackage{booktabs}
\def\xxx#1#2{{\tabcolsep1pt\begin{tabular}{p{4em}cp{4em}}\cellcolor{gray!20}#1&&\cellcolor{gray!20}#2\\\end{tabular}}}
\begin{document}
\extrarowheight2pt
\begin{tabular}{llll}\toprule
    foo & bah & Variability Process \\\midrule
    11 & 12 & \xxx{13}{14}\\
    21 & 22 & \xxx{23}{24}\\
    31 & 32 & \xxx{33}{34}\\\bottomrule
\end{tabular}
\end{document}

相关内容