質問: I use package `longtable` to make a table as follows. Please help to center the content in the first head and the head of the table. Thanks! ``` \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 ```
回答: Some comments and suggestions: * Don't embed a `longtable` environment inside a `center` environment -- the `longtable` is automatically centered horizontally. * By "center the content in the first head", I assume you wish to achieve horizontal centering. If that's correct, simply add `\multicolumn{1}{|c|}{...}` wrappers for the first column headers and `\multicolumn{1}{c|}{...}` for the second. An 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} ```