如何对齐列中的文本longtable
?我有一张这样的表格,但我不知道如何对齐文本或设置文本以适应列宽
\documentclass[12pt,a4paper,oneside]{report}
\usepackage{longtable} %Long tables
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\begin{longtable}[H]{|c|c|l|c|l|c|c|}
\hline
&&\begin{tabular}[c]{@{}l@{}}Staff poorly or\\not trained in\\the
archiving of the\\reports\end{tabular}&3&\begin{tabular}[c]
{@{}l@{}}Implementation of training programs at the\\start of the trial, during the trial\\and when new staff members are recruited\\and define clearly in a written document\\the require skills and experience\\to be part of the trial staff.\\The requirements should be defined by\\a member of the staff with enough\\experience. Monitorise through audit\\its accomplishment\end{tabular}&1&9\\
\hline
\end{longtable}
\end{landscape}
\end{document}
答案1
使用p{<width>}
列类型使文本在 内对齐<width>
。如果您还需要垂直居中,请使用m{<width>}
(需要array
包)。最后,为了防止单词连字符不美观(由于对齐),请m
在列前面加上>{\raggedright}
。
\documentclass[12pt,a4paper,oneside]{report}
\usepackage{longtable} %Long tables
\usepackage{pdflscape,array}
\begin{document}
\begin{landscape}
\begin{longtable}{|c|c|>{\raggedright}m{4cm}|c|>{\raggedright}m{7cm}|c|c|}
\hline
& & Staff poorly or not trained in the archiving of the reports & 3 &
Implementation of training programs at the start of the trial, during the trial and when new staff members are recruited and define clearly in a written document the require skills and experience to be part of the trial staff. The requirements should be defined by a member of the staff with enough experience. Monitorise through audit its accomplishment & 1 & 9 \\
\hline
\end{longtable}
\end{landscape}
\end{document}