
我不能使用多行和多列,我在下面的程式碼中的目標是有一個包含內容的兩行高度長標題垂直居中,分為兩行,我在這裡缺少什麼?
\begin{table*}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{|l|C|C|C|C|C|C|}
\hline
\bf{} & \multirow{2}{*}{\bf{Value}} & \multirow{2}{*}{\bf{Value}} & \bf{Some Value} & \bf{ome Value} & \multirow{2}{*}{\bf{ome Value}} & \multirow{2}{*}{\bf{Value}}
\\ \hline
\multicolumn{7}{|c|}{\multirow{2}{*}{A long header vertically centered in two rows}}
\\ \hline
\bf{Row header} & 12.34 & 12.34 & 12.34 & 12.34 & 12.34 & 12.34
\\ \hline
\end{tabularx}
\caption{Table results}
\label{results}
\end{table*}
答案1
你應該閱讀如何multirow
運作
\begin{table*}
\centering
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{|l|C|C|C|C|C|C|}
\hline
\textbf{} & \multirow{2}{*}{\textbf{Value}} & \multirow{2}{*}{\textbf{Value}} & \textbf{Some Value} & \textbf{ome Value} & \multirow{2}{*}{\textbf{ome Value}} & \multirow{2}{*}{\textbf{Value}}
\\ \hline
\multicolumn{7}{|c|}{\multirow{2}{*}{A long header vertically centered in two rows}}
\\ \multicolumn{7}{|c|}{} % add
\\ \hline
\textbf{Row header} & 12.34 & 12.34 & 12.34 & 12.34 & 12.34 & 12.34
\\ \hline
\end{tabularx}
\caption{Table results}
\label{results}
\end{table*}