使用 tblr 对表格中的列表进行垂直对齐

使用 tblr 对表格中的列表进行垂直对齐

我有以下代码:

\begin{table}[H]
  \centering
  \begin{tblr}{|X[j,valign=t] | X[j,valign=t]|X[j,valign=t]|X[j,valign=t]|}
  \hline
  Criteria & Sources(s) & Measures & Notes\\
  \hline
  Audience Engagement  & 
      \begin{itemize}][noitemsep] 
         \item TKTKTTK (1999) 
         \item TKTKTKT (2019) 
      \end{itemize} & 
      \begin{itemize}[noitemsep]
          \item TKTKTKTKT
          \item TKTKTKTKTT
      \end{itemize} & 
      fj; lfjalkjf;asdljfsdl; jfal;djfla jd; jlasdjf;ljf;ldj fla;dsj f;alj fadjljd\\
  \hline
  \end{tblr}
\end{table}

输出为:

桌子

第一列和最后一列垂直对齐到顶部,但中间两列(包含列表)居中。有什么办法可以解决这个问题吗?

答案1

请尝试以下操作:

\documentclass{article}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{tabularray}
    \UseTblrLibrary{varwidth}   % <---

\begin{document}
    \begin{table}[ht]
    \setlist[itemize]{nosep, itemsep=3pt, leftmargin=*}
\begin{tblr}{hlines, vlines,
             colspec = {X[l] X[l] X[l] X[l] },  % <--- changed
             stretch=-1,        % <---
             measure = vbox     % <---
              }
Criteria    
    &   Sources(s)      
        &   Measures    
            &   Notes           \\
Audience Engagement  
    &   \begin{itemize}
    \item   TKTKTTK (1999)
    \item   TKTKTKT (2019)
        \end{itemize}   
        &   \begin{itemize}
        \item TKTKTTK (1999)
        \item TKTKTKT (2019)
            \end{itemize}   
            &   fj; lfjalkjf; asdljfsdl; jfal; djfla jd; jlasdjf; ljf; ldj fla; dsj f; alj fadjljd                 \\
  \end{tblr}
\end{table}
\end{document}

在此处输入图片描述

相关内容