![メイクセル内の均等に垂直に間隔を空けた線](https://rvso.com/image/392342/%E3%83%A1%E3%82%A4%E3%82%AF%E3%82%BB%E3%83%AB%E5%86%85%E3%81%AE%E5%9D%87%E7%AD%89%E3%81%AB%E5%9E%82%E7%9B%B4%E3%81%AB%E9%96%93%E9%9A%94%E3%82%92%E7%A9%BA%E3%81%91%E3%81%9F%E7%B7%9A.png)
回転したヘッダーを持つテーブルと、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}