可能重复:
如何将表格的一行分成几列?
我想制作一张表格。这是我的代码
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{| c | c | c | c |}
\hline
\multirow{3}{*}{\textbf{TOTAL OF POINTS}} & \hspace{2.5cm} TEACHERS \hspace{2.5cm} & Number \\ & (Name and sign) & (President \\ & & Number of points) \\
\hline
First test\hspace{1cm} Second test & & \\
& & \\
& & \\
\cline{2-2}
& & \\
& & \\
& & \\
\hline
\end{tabular}
\end{document}
我怎样才能像图中一样在第一次测试和第二次测试之间画一条线?
答案1
更自然地将它们视为两个独立的列,并将表头保存在单个多行单元格中,如下所示:
\documentclass[a4paper, 11pt]{article}
\usepackage[left=15mm,right=15mm,top=20 mm,bottom=20mm]{geometry}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{answers}
\usepackage{array}
\setlength\extrarowheight{3pt}
\begin{document}
\vspace{0.5 cm}
\begin{tabular}{| *2{>{\centering}m{3cm}| }
>{\centering\arraybackslash}m{5cm}|
>{\centering\arraybackslash}m{5cm}|}
\hline
\multicolumn{2}{|c|}{\textbf{TOTAL OF POINTS}} &
TEACHERS \par (Name and sign) &
Number (President Number of points) \\
\hline
First test & Second test & & \\
& & & \\
& & & \\
\cline{3-3}
& & & \\
& & & \\
& & & \\
\hline
\end{tabular}
\end{document}