当我将文件下载为 pdf 时,我看到类似的内容,缺少边框。
我的代码如下:
{\rowcolors{2}{cyan!10}{white}
\begin{table}
\resizebox{\textwidth}{!}{
\begin{tabular}{ |s| p{0.7cm} |p{2cm} |p{0.7cm}| p{2cm} |p{2cm} |p{0.8cm} |p{2.1cm} |p{0.8cm} |p{0.8cm} |p{0.8cm} |p{0.8cm} |p{1cm}| p{1cm}| }
\hline
\rowcolor{azure} \multicolumn{13}{|c|}{Student 1} \\
\hline
{\fontsize{8pt}{9pt}\selectfont Exercise1} & {\fontsize{8pt}{9pt}\selectfont Exercise2} & {\fontsize{8pt}{9pt}\selectfont Exercise3 }& {\fontsize{8pt}{9pt}\selectfont Exercise4} & {\fontsize{8pt}{9pt}\selectfont Exercise5 } & {\fontsize{8pt}{9pt}\selectfont Exercise6} &{\fontsize{8pt}{9pt}\selectfont Exercise7 }&{\fontsize{8pt}{9pt}\selectfont Exercise8 } &{\fontsize{8pt}{9pt}\selectfont Exercise9} & {\fontsize{8pt}{9pt}\selectfont Exercise10 } & {\fontsize{8pt}{9pt}\selectfont Exercise11} & {\fontsize{8pt}{9pt}\selectfont Exercise12} & {\fontsize{8pt}{9pt}\selectfont Exercise13} \\
\hline
1& 0 & 0 & 0 & 0 & 0 & 2 & 83 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
2& 1 & 179 & 0 & 0 & 0 & 1 & 21 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
\vdots& \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
221& 7 & 101 & 0 & 0 & 0 & 4 & 103 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
222& 5 & 78 & 1 & 47 & 50 & 0 & 0 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
\hline
\end{tabular}
}
\caption{Extended Raw Data Table for one student}
\label{Extended_data}
\end{table}
}
答案1
无关:
通过以下代码更改,您将获得更好看的表格:
- 消除
\resizebox
- 定义相等的列宽
array
在数学环境中使用:
\documentclass{article}
\usepackage[table,svgnames]{xcolor}
\usepackage{array}
\usepackage{amsmath}
\begin{document}
\begin{table}[ht]
\small
\setlength\arraycolsep{4pt}
\renewcommand\arraystretch{1.2}
\rowcolors{2}{cyan!10}{white}
$
\begin{array}{ |c| *{13}{w{c}{2em}|} }
\hline
\rowcolor{DodgerBlue}
\multicolumn{13}{|c|}{\text{Student 1}} \\
\hline
\multicolumn{13}{|c|}{\text{Exercises}} \\
\hline
1 & 2 & 3 & 4 & 5 & 6
& 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
\hline
1 & 0 & 0 & 0 & 0 & 0 & 2 & 83 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
2 & 1 & 179 & 0 & 0 & 0 & 1 & 21 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
\vdots& \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
221& 7 & 101 & 0 & 0 & 0 & 4 & 103 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
222& 5 & 78 & 1 & 47 & 50 & 0 & 0 & -2.5 & -0.1 & -0.4 & 1 & 7 \\
\hline
\end{array}
$
\caption{Extended Raw Data Table for one student}
\label{Extended_data}
\end{table}
\end{document}
在苏门答腊,pdf 查看器表格如下所示: