使用 tabu 创建表

使用 tabu 创建表

我正在尝试创建一个表格,其中的标题文本水平和垂直居中。第一列(标题行除外)中的文本应垂直书写。到目前为止,我有这个。

\begin{table}[!ht]
\centering
\begin{tabu} to \textwidth {| X[c,m] | X[c,m] | X[c,m] | X[c,m] |} 
 \hline
 Konzept & Kamera + RGB-Sensor & Liniensensor + Ultraschall + RGB-Sensor & Stereokamera \\
 \hline
 \begin{rotate}{90}Beschreibung\end{rotate} & 6 & 87837 & 787 \\ 
 Vorteile & 7 & 78 & 5415 \\
 Nachteile & 545 & 778 & 7507 \\
 Risiko & 545 & 18744 & 7560 \\
 \hline
\end{tabu}
\caption{Beispiele für die Konzeptfindung.}
\label{tab:Beispiele_Konzeptfindung}
\end{table}

这导致了这样的输出: 输出

我如何才能仅调整第一行使其水平对齐?我如何才能调整旋转命令,使文本保留在其单元格中?

答案1

Do you want the table like this.
\documentclass{article}
\usepackage{float}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{graphicx}
\newcommand{\rot}[1]{\rotatebox[origin=l]{90}{#1}}
\usepackage{siunitx}
\usepackage{array}
\usepackage{ragged2e}
\usepackage{microtype}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular} {@{}>{\RaggedRight}b{3cm}*{3}{S[table-format=4.1]}@{}}
\toprule
{\rot{ Konzept}} &{\rot{\parbox{2cm}{ Kamera + \\RGB-Sensor}}} & 
{\rot{\parbox{2cm}{Liniensensor+\\ Ultraschall +\\ RGB-Sensor}}} & 
{\rot{Stereokamera}} \\
\midrule
Beschreibung & 6 & 87837 & 787\\
Vorteile & 7 & 78 & 5415 \\
Nachteile & 545 & 778 & 7507 \\
Risiko & 545 & 18744 & 7560 \\
\bottomrule
\end{tabular}
\caption{Beispiele für die Konzeptfindung.}
\label{tab:Beispiele_Konzeptfindung}
\end{table}
\end{document}

禁忌输出

相关内容