如何打破表格中的標題標題

如何打破表格中的標題標題

請問,如何打破表格中的標題?

\begin{table}[H]
\begin{tabular}[h]{|p{2cm}||p{2cm}} 
\hline
{title one} & {title two}   \\ \hline\hline
\end{tabular}
\caption{title}
\end{table}

謝謝。

答案1

您可以將\parboxes 與換行指令一起使用;在框框中,您可以使用 \centering 將內容置中:

\documentclass{article}

\begin{document}

\begin{table}
\centering
\begin{tabular}{|p{2cm}|p{2cm}|} 
\hline
\parbox[t]{2cm}{\centering title \\ one} & \parbox[t]{2cm}{\centering title \\ two} \\[3ex]
some text & some text \\
some text & some text \\
\hline
\end{tabular}
\caption{title}
\end{table}

\end{document}

在此輸入影像描述

我使用垂直規則作為視覺參考點。順便說一句,對於如此狹窄的列,您可以考慮將它們設置為右側參差不齊。

相關內容