我想知道如何使表格中的文本垂直和水平居中吗?
我已看过几本手册并回答过问题,但创建表格的方法有很多,而由于我是 Tex 的初学者,所以我找不到任何解决方案。
谢谢!!!
这是我的代码:
\documentclass[]
{report}
\usepackage{graphicx}
\usepackage[nohyperlinks]{acronym}
\usepackage{subfigure}
\usepackage[none]{hyphenat}
\usepackage{array}
\usepackage{adjustbox}
\begin{document}
\begin {table}
\centering
\begin{tabular}{ | p{10cm} | c | c |}
\hline
Scenario & A & B \\ \hline
Subscenario & A.1 & B.1 \\ \hline
Number of registered individuals/impostors & 25/65 & 23/14 \\ \hline
Number of face images of registered individuals/impostors & 6549/223 & 1082/20182 \\ \hline
Total number of face images per scenario registered individuals/impostors & 619/223 & 1082/41\\ \hline
Total number of face images registered individuals/impostors & \multicolumn{2}{ |c| }{ 1701/264 } \\ \hline
\end{tabular}
\caption{Description of the IFaViD's image test set}
\label{IFaViD_img}
\end{table}
\end{document}
答案1
您可以使用m
列类型。
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}[htb]
\centering
\begin{tabular}{ | m{10cm} | c | c |}
\hline
Scenario & A & B \\ \hline
Subscenario & A.1 & B.1 \\ \hline
Number of registered individuals/impostors & 25/65 & 23/14 \\ \hline
Number of face images of registered individuals/impostors & 6549/223 & 1082/20182 \\ \hline
Total number of face images per scenario registered individuals/impostors & 619/223 & 1082/41\\ \hline
Total number of face images registered individuals/impostors & \multicolumn{2}{ |c| }{ 1701/264 } \\ \hline
\end{tabular}
\caption{Description of the IFaViD's image test set}
\label{IFaViD_img}
\end{table}
\end{document}