tabularx 的标题

tabularx 的标题

我该如何对齐标题,使其不超过表格和文本的宽度?如果标题太长,我实际上希望将其打印到下一行...有什么建议吗?

\documentclass{scrartcl}

\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}

\begin{table}[ht]
  \caption{Hello}
  \begin{tabularx}{\textwidth}{XX}\toprule
    \multicolumn{2}{c}{Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello \textellipsis}\\ \midrule
    \textbf{Hello} & \textellipsis Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello\\ \midrule
    \textbf{Hello} & \textellipsis Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello\\      \midrule
    \textbf{Hello} & \textellipsis Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello\\ \midrule
    \textbf{Hello} & \textellipsis Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello\\ \bottomrule
  \end{tabularx}
\end{table}

\end{document}

相关内容