tabularray:如何控制单元格内容的垂直对齐?

tabularray:如何控制单元格内容的垂直对齐?

对于以下内容,我想了解

1- rows={b}columns={b}cells={b}应该做什么

2-为什么它们都没有按照选项的指示使行的内容底部对齐b

在此处输入图片描述

\documentclass{article}
\usepackage[paperheight=75mm]{geometry}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
    
    \begin{tblr}[long, caption = {The Caption II}]
        {
            rows = {5.0ex, b},
            cells = {b},
            columns = {b},
            hlines = {white,1.0pt},
            rulesep = 0pt,
            width = 0.5\linewidth,
            colspec = {XX}, 
            row{odd} = {blue!15}, 
            row{even} = {gray!15},
            rowhead = 1,
            row{1} = {red!20},
        }
        \toprule[1.5pt] 
        \hline[white,1.0pt]
        One & Two  \\
        \midrule
        \hline[white,1.0pt]
        1  &   2  \\
        3  &   4  \\
        5  &   6  \\
        7  &   8  \\
        9  &  10  \\
        \bottomrule[1.5pt]
    \end{tblr}
\end{document}

答案1

请参阅我在问题中的回答表格中的 p、m 和 b 列. 你真正想要的是f对齐。

\documentclass{article}
\usepackage[paperheight=75mm]{geometry}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
    
    \begin{tblr}[long, caption = {The Caption II}]
        {
            rows = {5.0ex, f},
            hlines = {white,1.0pt},
            rulesep = 0pt,
            width = 0.5\linewidth,
            colspec = {XX}, 
            row{odd} = {blue!15}, 
            row{even} = {gray!15},
            rowhead = 1,
            row{1} = {red!20},
        }
        \toprule[1.5pt] 
        \hline[white,1.0pt]
        One & Two  \\
        \midrule
        \hline[white,1.0pt]
        1  &   2  \\
        3  &   4  \\
        5  &   6  \\
        7  &   8  \\
        9  &  10  \\
        \bottomrule[1.5pt]
    \end{tblr}
\end{document}

在此处输入图片描述

相关内容