多行表中的水平对齐

多行表中的水平对齐

我有一张表格,我希望其第一列水平居中,单元格如下:

  • “带注释的消息”

  • “注释流程”

  • “提供指南”

  • “注释者协议”

有两条线,但我遇到了问题。

我对乳胶表格还不熟悉......

另外,我不知道为什么表格没有居中......

在此处输入图片描述

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\begin{table}[H]
    \begin{tabular}{P{2.5cm}|P{2.5cm}|P{2.5cm}|P{2.5cm}|P{2.5cm}|P{2.5cm}}
    \hline
    \multirow{3}{*}{\textbf{Paper}}  & \textbf{\cite{Davidson2017}} & \textbf{\cite{Nobata2017}} & \textbf{\cite{Zhang17}} &  \textbf{\cite{Warner}} & \textbf{\cite{Kwok2013}}\\
    \hline
    \multirow{5}{*}{\textbf{Collection}} &  Twitter search engine with words present in Hatebase.org. lexicon. & Comments posted on Yahoo! Finance and News. & Twitter seach engine about refugees and Muslims & Yahoo! News and offensive websites id by AJC. & Twitter accounts known to be racist.\\
    \hline 
    \multirow{2}{*}{\textbf{Annotated messages}} & 25.000 tweets & 2.000 comments & 2.435 tweets & 1.000 paragraphs & 24.582 tweets\\
    \hline 
    \multirow{4}{*}{\textbf{Annotation Process}} & At least three CrowdFlower workers. & Mechanical Turk experiment. & unanimous agreement between two researchers & Three annotators & annotated by authors \\
    \hline
    \multirow{2}{*}{\textbf{Provided Guidelines}} & yes & yes & no & no & no\\
    \hline
    \multirow{3}{*}{\textbf{Annotator Agreement}} & Inter-coder agreement of 92\% & Fleiss's Kappa of 0.401 & unanimous agreement & Fleiss's Kappa of 0.63 & -\\
    \hline
    \end{tabular}
    \smallskip
    \caption{Dataset annotation process used in other studies}
\end{table}

答案1

multirow对于此表,您不需要:只需使用tabularx,将X列类型重新定义为X{#1}

无关:您应该避免使用H安置字母——它通常会导致页面上出现大片空白。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage{tabularx, float}

\begin{document}

\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\begin{table}[H]
\centering
\setlength{\extrarowheight}{2pt}
    \begin{tabularx}{\linewidth}{>{\bfseries}X|*{5}{X|}}
    \hline
    Paper & \textbf{\cite{Davidson2017}} & \textbf{\cite{Nobata2017}} & \textbf{\cite{Zhang17}} & \textbf{\cite{Warner}} & \textbf{\cite{Kwok2013}}\\
    \hline
    Collection & Twitter search engine with words present in Hatebase.org. lexicon. & Comments posted on Yahoo! Finance and News. & Twitter seach engine about refugees and Muslims & Yahoo! News and offensive websites id by AJC. & Twitter accounts known to be racist.\\
    \hline
   Annotated messages & 25.000 tweets & 2.000 comments & 2.435 tweets & 1.000 paragraphs & 24.582 tweets\\
    \hline
    Annotation Process & At least three CrowdFlower workers. & Mechanical Turk experiment. & unanimous agreement between two researchers & Three annotators & annotated by authors \\
    \hline
    Provided Guidelines & yes & yes & no & no & no\\
    \hline
   Annotator Agreement & Inter-coder agreement of 92\% & Fleiss's Kappa of 0.401 & unanimous agreement & Fleiss's Kappa of 0.63 & – \\
    \hline
    \end{tabularx}
    \smallskip
    \caption{Dataset annotation process used in other studies}
\end{table}

\end{document} 

在此处输入图片描述

相关内容