我使用数组环境构建了一个数据表:
\documentclass[12pt,landscape]{article}
\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}% for top-,mid- & bottomrule
\begin{document}
$
\begin{array}{lcc}
\toprule
&\text{1\textsuperscript{st} growth period} & \text{2\textsuperscript{nd} growth period} \\
\midrule
\text{Estonia} & 1.28 & 1.72 \\
\text{Slovenia} & 1.26 & 0.21 \\
\text{Czech Republic} & 1.16 & 0.46 \\
\text{...} & \text{...} & \text{...} \\
\text{...} & \text{...} & \text{...} \\
\hline
\text{Mean} & 0.69 & 0.53 \\
\text{Lower-Quantile} & 0.37 & 0.21 \\
\text{Upper-Quantile} & 0.99 & 0.80\\
\bottomrule
\end{array}
$
现在我想给我的表格添加一个标题。有人有想法吗?
答案1
我不太清楚为什么你没有使用tabular
,但如果你想添加标题,你可以\captionof
从caption
包中使用。请注意,\captionof
代表“浮动外的标题”
\documentclass[12pt,landscape]{article}
\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}% for top-,mid- & bottomrule
\usepackage{caption}
\begin{document}
\begin{center}
$
\begin{array}{lcc}
\toprule
&\text{1\textsuperscript{st} growth period} & \text{2\textsuperscript{nd} growth period} \\
\midrule
\text{Estonia} & 1.28 & 1.72 \\
\text{Slovenia} & 1.26 & 0.21 \\
\text{Czech Republic} & 1.16 & 0.46 \\
\text{...} & \text{...} & \text{...} \\
\text{...} & \text{...} & \text{...} \\
\hline
\text{Mean} & 0.69 & 0.53 \\
\text{Lower-Quantile} & 0.37 & 0.21 \\
\text{Upper-Quantile} & 0.99 & 0.80\\
\bottomrule
\end{array}
$
\captionof{table}{My caption}
\end{center}
\end{document}