我制作了这张表,但它看起来不太好看。我该如何改进它?谢谢!
\documentclass[a4paper, 11pt]{article}
\usepackage{tabularx}
\begin{document}
\begin{center}
\begin{tabular}{ | m{4em} | m{1.3cm}| m{1.3cm} | m{1cm} | }
\hline & Gedopt & Nicht . &\\
\hline
Test zeigt positiv & $\frac{0,999}{600}$ & $\frac{1,2}{600}$ & $\frac{2.199}{600}$ \\
\hline
Test zeigt negativ & $\frac{0,001}{600}$ & $\frac{597,8}{600}$ & $\frac{597,8}{600}$\\
\hline
~~~~~~~~~~~~~~~~~~~~~~~~ & $\frac{1}{600}$ & $\frac{599}{600}$ & \\
\hline
\end{tabular}
\end{center}
\end{document}
答案1
使用booktabs
包并去掉垂直线:
\documentclass[a4paper, 11pt]{article}
\usepackage{tabularx}
\usepackage{booktabs}
\begin{document}
\begin{center}
\begin{tabular}{m{4em}m{1.3cm}m{1.3cm}m{1cm}}
\toprule & Gedopt & Nicht . &\\
\midrule
Test zeigt positiv & $\frac{0,999}{600}$ & $\frac{1,2}{600}$ & $\frac{2.199}{600}$ \\
\midrule
Test zeigt negativ & $\frac{0,001}{600}$ & $\frac{597,8}{600}$ & $\frac{597,8}{600}$\\
\midrule
~~~~~~~~~~~~~~~~~~~~~~~~ & $\frac{1}{600}$ & $\frac{599}{600}$ & \\
\bottomrule
\end{tabular}
\end{center}
\end{document}
编辑
@Zarko 的回答比我的好。
答案2
也许像这样?
\documentclass[a4paper, 11pt]{article}
\usepackage{amsmath}
\usepackage{booktabs, makecell}
\setcellgapes{5pt}
\begin{document}
\begin{tabular}{ l *{3}{>{$\displaystyle}l<{$}} }
\toprule
& \text{Gedopt} & \text{Nicht} &\\
\midrule
Test zeigt positiv & \frac{0,999}{600} & \frac{1,2}{600} & \frac{2.199}{600}\\
Test zeigt negativ & \frac{0,001}{600} & \frac{597,8}{600} & \frac{597,8}{600}\\
& \frac{1}{600} & \frac{599}{600} & \\
\bottomrule
\end{tabular}
\end{center}
\end{document}
答案3
“更好看”是一个非常主观和广泛的概念。当然,有booktabs
或没有垂直,但除此之外,您还可以尝试其他策略,例如使用小数对齐,或更改分数样式,或重新设计表格:
\documentclass[a4paper, 11pt]{article}
\usepackage{amsmath,nicefrac}
\usepackage{siunitx}
\usepackage{booktabs, makecell}
\setcellgapes{5pt}
\begin{document}
\begin{tabular}{ l *{3}{S}}
\toprule
& \text{Gedopt} & \text{Nicht} &\\
\midrule
Test zeigt positiv & \nicefrac{0,999}{600} & \nicefrac{1,2}{600} & \nicefrac{2.199}{600}\\
Test zeigt negativ & \nicefrac{0,001}{600} & \nicefrac{597,8}{600} & \nicefrac{597,8}{600}\\
& \nicefrac{1}{600} & \nicefrac{599}{600} & \\
\bottomrule
\end{tabular}
\bigskip
\begin{tabular}{ l *{3}{S} }
\toprule
Test zeigt ($\times600$) & \text{Gedopt} & \text{Nicht} & \\
\midrule
Positiv & 0,999 & 1,2 & 2.199\\
Negativ & 0,001 & 597,8 & 597,8\\
& 1 & 599 & \\
\bottomrule
\end{tabular}
\end{document}