我使用包longtable
制作了一个表格,如下所示。请帮助将内容置于表格的第一个标题和标题的中心。谢谢!
\begin{center}
\renewcommand\tablename{Appendix}
\begin{longtable}{| p{0.3 \textwidth} | p{0.6 \textwidth} |}
\caption{\bf Outline of PS(V) 1.8c-12} \label{appendix2} \\
\hline \ PS(V) 1.8c-12 & Outline} \\ \hline \hline
\endfirsthead
\multicolumn{2}{c}%
{{\bfseries \tablename\ \thetable{}: Outline of PS(V) 1.8c-12}} \\
\hline {PS{V} 1.8c-12} & {Outline} \\ \hline \hline
\endhead
\hline \multicolumn{2}{|r|}{{\tiny Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\hline
答案1
一些意见和建议:
不要将
longtable
环境嵌入到环境中center
——它longtable
会自动水平居中。通过“将内容置于第一个标题的中心”,我假设您希望实现水平居中。如果这是正确的,只需
\multicolumn{1}{|c|}{...}
为第一个列标题和\multicolumn{1}{c|}{...}
第二个列标题添加包装器即可。
MWE:
\documentclass{article}
\usepackage{longtable}
\begin{document}
\renewcommand\tablename{Appendix}
\begin{longtable}{| p{0.3\textwidth} | p{0.6\textwidth} |}
\caption{\bf Outline of PS(V) 1.8c-12} \label{appendix2} \\
\hline
\multicolumn{1}{|c|}{PS(V) 1.8c-12} & \multicolumn{1}{c|}{Outline} \\
\hline \hline
\endfirsthead
\multicolumn{2}{c}{\bfseries\tablename\ \thetable: Outline of PS(V) 1.8c-12} \\
\hline
\multicolumn{1}{|c|}{PS(V) 1.8c-12} & \multicolumn{1}{c|}{Outline} \\
\hline \hline
\endhead
\hline
\multicolumn{2}{r@{}}{\tiny Continued on next page} \\
\endfoot
\hline \hline
\endlastfoot
123 & abc \\
\hline
123 & abc \\
\hline
123 & abc \\
\end{longtable}
\end{document}