帶有旋轉側標題的多行表

帶有旋轉側標題的多行表

我正在嘗試從多行表中刪除規則:

\begin{table}[ht]
\centering
\begin{tabular}{@{}cl|cll@{}}
 & & \multicolumn{3}{c}{\textsc{Columns}} \\
 & & A & B & C \\ \cmidrule(l){3-5} 
\multirow{3}{*}{\rotatebox[origin=c]{90}{\textsc{Rows}}}
    & 1 & A1 & B1 & C1 \\
    & 2 & A2 & B2 & C2 \\
    & 3 & A3 & B3 & C3 \\
\end{tabular}
\caption{Caption}
\label{tab:my-table}
\end{table}

輸出看起來像這樣:

在此輸入影像描述

但是,我無法刪除頂部這條不必要的小垂直線(Columns 和 ABC 左側的垂直線)。

所以我只嘗試實現一條捕獲第 1、2 和 3 行的垂直線。

有任何想法嗎?謝謝!

答案1

像這樣;

在此輸入影像描述

\documentclass{article}

\usepackage{booktabs, multirow}
\usepackage{graphicx}

\begin{document}
    \begin{table}[ht]
    \centering
\begin{tabular}{ cl|cll}
\multicolumn{2}{c}{} % remove vertical lines in this cell
        & \multicolumn{3}{c}{\textsc{Columns}}  \\
\multicolumn{2}{c}{} % remove vertical lines in this cell
        &   A   &   B   &   C                   \\ 
    \cmidrule(l){3-5}
\multirow{3}{*}{\rotatebox[origin=c]{90}{\textsc{Rows}}}
    & 1 & A1 & B1 & C1 \\
    & 2 & A2 & B2 & C2 \\
    & 3 & A3 & B3 & C3 \\
\end{tabular}
    \caption{Caption}
    \label{tab:my-table}
\end{table}
\end{document}

相關內容