长表垂直对齐

长表垂直对齐

如何使 longtable 单元格内容垂直居中?我尝试了很多解决方案,但都没有用。

\begin{center}
\begin{longtable}{ | P{5cm} | P{8cm}|}
\caption{Architectures used in Experiments  }
\label{con_names} \\

\hline
\thead{Architecture}&\thead{Description} \\  \hline
\endhead
Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ \hline
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ \hline


\end{longtable}
\end{center}

答案1

longtblr这只是包中的一个示例tabularray

正如 leandriis 在其评论中所说,|m{5cm}|m{8cm}|也适用于longtable

的优点longtblr是使用hlines选项时您不需要\hline在每一行后写入(并且vlines您不必输入|列定义)。

\documentclass{book}
\usepackage{geometry}
\usepackage{tabularray}
\begin{document}
\begin{longtblr}[
    caption={Architectures used in Experiments},
    label=con_names
    ]{
    colspec={m{5cm}m{8cm}}, 
    vlines,
    hlines,
    rowhead=1,
    row{1}={font=\bfseries}
    }
Architecture & Description\\  
Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ 
Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ Double-head architecture   & GPT-2 model with languae model head and classification head for persona-chat dataset and Multi-turn chatbot dataset   \\ 
Single-head architecture & GPT-2 model with languae model head for Multi-turn chatbot dataset  \\ 
\end{longtblr}
\end{document}

在此处输入图片描述

相关内容