
我正在嘗試創建一個其中包含一些旋轉文字的表格,但旋轉文字延伸到單元格下方的行中,如下所示:
這是我的螢幕在 Lyx 中的樣子:
我嘗試過使用多行、多列和旋轉文本,但無濟於事。現在,最左列中的儲存格透過使用Rotate cell by 90
Lyx 中的函數。
答案1
這是一個方法。我使用makecell
和rotating
包,加上hhline
(普通的水平最後一行和垂直第一行不能很好地連接)和caption
(為了標題和表格之間的正確垂直間距):
\documentclass{article}%
\usepackage{graphicx}
\usepackage[ margin = 2.5cm]{geometry}
\usepackage{tabularx, booktabs, array, rotating, multirow}
\ usepackage{hhline}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\setcellgapes{3pt}
\begin{document}
\noindent\setlength\tabcolsep{4pt}\footnotesize\makegapedcells
\begin{tabularx}{\linewidth}{l|l*{3}{|X}|}
\cline{3-5}
\multicolumn{2}{c|}{} & \thead{Lorem Ipsum Lorem Ipsum} & \thead{Lorem Ipsum Lorem Ipsum} & \thead{Lorem Ipsum Lorem Ipsum}\\
\cline{2-5}
\multirowcell{9}[-2pt]{ \rotatebox{90}{{Lorem Ipsum}}} & Lorem Ipsum & & & \\
\cline{2-5}
& Lorem Ipsum & & & \\
\cline{2-5}
& Lorem Ipsum & & & \\
\cline{2-5}
& Lorem Ipsum & & & \\
\cline{2-5}
& Lorem Ipsum & & & \\
\cline{2-5} & Lorem Ipsum & & & \\
\hhline{~|----|}
\end{tabularx}
\end{document}