我想在 Latex 中模仿下面的调查格式。我想知道是否有人可以提供一个简短的示例,说明如何确保每个框内的文本垂直对齐以符合此样式,好吗?
将不胜感激。
\begin{table}[H]
\scriptsize
\vspace{1em}
\centering
\captionsetup{font=footnotesize}
\captionsetup[figure]{skip=20pt}
\caption{EQ-5D-3L Instrument:}
\vspace*{1mm}
\begin{tabular*}{\columnwidth}{ @{\extracolsep{\fill}} P{2.0cm} P{2.5cm} P{7.5cm}}
\midrule
\midrule
Dimension & Level & Description\\
\midrule
\midrule
\\ Mobility & 1 & I have no problem in walking about
\\ & 2 & I have some problems in walking about
\\ & 3 & I am confined to bed
\\
\midrule
\midrule
\end{tabular*}
\end{table}
答案1
您应该提供 MWE(最小工作示例),这是一份包含表格的小型但完整的文档。因此,我们不会获得有关您的文档的任何信息,也不会获得表格列规范的定义。
代码片段仅包含前三行表格,
如果我将您的代码插入到某个小文档中而不是˙P
columns (which are undefined) use standard
p`,则可以正常工作,那么问题是什么?下面是 MWE 的一个示例,用于表格使用
tabularray
包:
\documentclass{article}
\usepackage{geometry}
\usepackage[skip=1ex,
font=footnotesize]{caption}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{table}[ht]
\centering
\caption{EQ-5D-3L Instrument:}
\begin{tblr}{colspec = {@{} l c X[l] @{}},
row{1} = {font=\bfseries, bg=gray!30}
}
\toprule
Dimension & Level & Description\\
\midrule
Mobility & 1 & I have no problem in walking about \\
& 2 & I have some problems in walking about \\
& 3 & I am confined to bed \\
\addlinespace
Self-care (SC)
& 1 & I have no problem with self-care \\
& 2 & I have some problems with washing and dressing myself \\
& 3 & I am unable to bed wash and dress myself \\
\bottomrule
\end{tblr}
\end{table}
\end{document}
这使:
- 请告诉我们您的问题到底是什么?