メイクセル内の均等に垂直に間隔を空けた線

メイクセル内の均等に垂直に間隔を空けた線

回転したヘッダーを持つテーブルと、makecells回転したヘッダーを 1 行に収めるためのテーブルがいくつかあります。

\documentclass{article}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{rotating}

\renewcommand\theadfont{\normalsize}

\begin{document}
\begin{table}[t]
\centering
\begin{tabular}{cccc}
    \toprule
     & & \multicolumn{2}{c}{\textbf{Condition A}} \\
     & & A1 & A2 \\
    \cmidrule{3-4}
    \settowidth\rotheadsize{\theadfont \textbf{Condition B}}
    \rothead{\textbf{Sampling}} & \makecell{B1 \\ B2} & \makecell{xx/xx \\ xx/xx} & \makecell{xx/xx \\ xx/xx} \\
    \bottomrule
\end{tabular}
\caption{Results under different conditions}
\end{table}
\end{document}

セル内のテキストをmakecells中央揃えにするのではなく、セル内で垂直方向に均等に配置したいのですが、これを行う簡単な方法はありますか?

答え1

あなたが何を望んでいるのかよく理解できれば、\rotatebox[origin=c]これで十分です:

\documentclass{article}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{rotating}

\renewcommand\theadfont{\normalsize}

\begin{document}

\begin{table}[t]
\centering
\renewcommand{\cellset}{\renewcommand{\arraystretch}{1.6}}
\begin{tabular}{cccc}
    \toprule
     & & \multicolumn{2}{c}{\textbf{Condition A}} \\
     & & A1 & A2 \\
    \cmidrule{3-4}
   \rotatebox[origin=c]{90}{\textbf{Sampling}} & \makecell{B1 \\ B2} & \makecell{xx/xx \\ xx/xx} & \makecell{xx/xx \\ xx/xx} \\
    \bottomrule
\end{tabular}
\caption{Results under different conditions}
\end{table}

\end{document} 

ここに画像の説明を入力してください

関連情報