将所有文本添加到表格的一个单元格中,并能够看到其他列

将所有文本添加到表格的一个单元格中,并能够看到其他列

我想要一个有三列的表格。第一列有长文本,其他列有短文本。我正在使用以下代码:但第一列中的文本无法看清,其他列消失如图所示。请帮助我。谢谢

\tabcolsep=0.11cm
\begin{table*}
    \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
    \caption{SegNet Performance with Different Optimizers.}

    \centering
    \begin{tabular}{|c|c|c|}\hline
        \tabincell{c}{Text Message} & \tabincell{c}{Video Number} & \tabincell{c}{State}\\\hline
        part of the Semantic feature have proved to be a very good
        feature if the little effort in making paraphrases in the corpus
        can be done. & \tabincell{c}{74} & \tabincell{c}{craving}\\\hline
        Computer Science is a specialized domain, and so any or-
        dinary paraphrases generation cannot be easily used here
        unless there is a human effort be involving in marking the
        words that can be permuted from the original to form true or
accurate paraphrases & \tabincell{c}{0.8219} & \tabincell{c}{0.8014} \\\hline
    \end{tabular}
\vspace{0.25 cm}
\label{tab2.Spec}
\end{table*}

!!

答案1

使用tabularx并将第一列标题设置为X

\documentclass{article}
\usepackage{amsmath,tabularx}
\begin{document}

\tabcolsep=0.11cm
\begin{table}
    \centering
    \caption{SegNet Performance with Different Optimizers.}
    \smallskip

    \begin{tabularx}{\textwidth}{|X|c|c|}\hline
        Text Message & Video Number & State \\ \hline
        part of the Semantic feature have proved to be a very good
        feature if the little effort in making paraphrases in the corpus
        can be done. & 74 & craving  \\ \hline
        Computer Science is a specialized domain, and so any or-
        dinary paraphrases generation cannot be easily used here
        unless there is a human effort be involving in marking the
        words that can be permuted from the original to form true or
accurate paraphrases & 0.8219 & 0.8014 \\ \hline
    \end{tabularx}
\label{tab2.Spec}
\end{table}    

\end{document}

在此处输入图片描述

答案2

这是一个解决方案,(a)与给出的解决方案非常相似@AboAmmar 的回答,因为它使用tabularx环境和X第一列的列类型,并且 (b) 通过省略所有垂直规则并使用更少但间距适当的水平规则,使表格具有更开放的“外观”。

请注意,所有\tabincell“包装器”指令都可以省略。

在此处输入图片描述

\documentclass{article}
\usepackage{tabularx,booktabs}
\usepackage[skip=0.333\baselineskip]{caption} % optional
\begin{document}
\begin{table*}
%\tabcolsep=0.11cm  % is this really needed?
\caption{SegNet Performance with Different Optimizers.}
\label{tab2.Spec}
\begin{tabularx}{\textwidth}{@{}Xcc@{}}
\toprule
Text Message & Video Number & State\\
\midrule
Part of the Semantic feature have proved to be a very good feature if the little effort in making paraphrases in the corpus can be done. 
& 74 & craving\\
\addlinespace
Computer Science is a specialized domain, and so any ordinary paraphrases generation cannot be easily used here unless there is a human effort be involving in marking the words that can be permuted from the original to form true or accurate paraphrases. 
& 0.8219 & 0.8014 \\
\bottomrule
\end{tabularx}
\end{table*}
\end{document} 

相关内容