旋轉多行多行文本

旋轉多行多行文本

我正在嘗試建立一個基本表並提出了以下程式碼。我的問題是旋轉的盒子奇怪地對齊: 在此輸入影像描述

最佳情況下,所有小旋轉框應左右居中,跨行旋轉框應左右居中。我嘗試將 origin=c 與rotatebox一起使用,但它沒有改變任何東西。

\begin{table}
\begin{tabularx}{\textwidth}{X|X|X|X|X|X|X}
\multirow{2}{*}{\rotatebox[]{90}{Tool}} & \multicolumn{2}{c|}{\makecell{Usability,\\ Consistency,\\Reuse}} & \multicolumn{3}{c|}{Support for \ac{UCSD}} & \multirow{2}{*}{\rotatebox[]{90}{\makecell{Structured\\Storage}}} \\
& \rotatebox[origin=c]{90}{\makecell{Shape\\Recognition}} & \rotatebox[origin=c]{90}{\makecell{Similarity\\Search}} & \rotatebox[origin=c]{90}{\makecell{Real-Time\\Collaboration}} & \rotatebox[origin=c]{90}{\makecell{Low- \& High\\Fidelity\\Prototypes}} & \rotatebox[origin=c]{90}{\makecell{Interactive\\Testing}} & \\ \hline
\end{tabularx}

\caption{Comparison}
\label{tab:existing_tools}
\end{table}

答案1

在此輸入影像描述

\documentclass{article}
\usepackage{rotating}
\usepackage{makecell, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \begin{table}
    \settowidth\rotheadsize{Recogniti}
\begin{tabularx}{\textwidth}{C|C|C|C|C|C|C}
    & \multicolumn{2}{c|}{\makecell[b]{Usability,\\ Consistency,\\Reuse}}
        & \multicolumn{3}{c|}{Support for UCSD}
            &                                           \\
\rothead{Tool}
    & \rothead{Shape\\Recognition}
        & \rothead{Similarity\\Search}
            & \rothead{Real-Time\\Collaboration}
                & \rothead{Low- \& High\\Fidelity\\Prototypes}
                    & \rothead{Interactive\\Testing}
                        & \rothead{Structured\\Storage} \\
    \hline
\end{tabularx}

\caption{Comparison}
\label{tab:existing_tools}
\end{table}
\end{document}

相關內容