我正在使用以下代码,但没有获得垂直中间对齐,如下图所示:
\documentclass{article}
\usepackage{lipsum}
\usepackage[latin]{babel}
\usepackage{ragged2e}
\usepackage{tabularray}
\begin{document}
\begin{longtblr}[
caption = {my table caption.},
]{hlines, vlines,
colspec = {X[0.2,c,m] X[0.1,c,m] X[0.1,c,m]
X[0.6,cmd={\RaggedRight\hspace{0pt}}]},
row{1} = {font=\bfseries},
rowhead = 1,
}
A & B & C & D \\
2022 & 2022 & 2022 & \lipsum[1-1][1-3] \\
2023 & 2023 & 2023 & \lipsum[2-4][3] \\
\end{longtblr}
\end{document}
你能帮帮我吗?谢谢!
答案1
单元格的高度由最后一列决定。您需要将此列垂直居中:
\documentclass{article}
\usepackage{lipsum}
\usepackage[latin]{babel}
\usepackage{ragged2e}
\usepackage{tabularray}
\begin{document}
\begin{longtblr}[
caption = {my table caption.},
]{hlines, vlines,
colspec = {X[0.2,c] X[0.1,c] X[0.1,c]
X[0.6,cmd={\RaggedRight\hspace{0pt}},m]},
row{1} = {font=\bfseries},
rowhead = 1,
}
A & B & C & D \\
2022 & 2022 & 2022 & \lipsum[1-1][1-3] \\
2023 & 2023 & 2023 & \lipsum[2-4][3] \\
\end{longtblr}
\end{document}