列宽哪里出错了?

列宽哪里出错了?

我正在尝试创建一个具有不同列宽的表格。这是我目前所拥有的。

\usepackage{graphicx} %to scale table

\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X} % centered "X" column

\usepackage{lscape}
\newcolumntype{b}{>{\hsize=2.3\hsize}X}
\newcolumntype{s}{>{\hsize=.3\hsize}X}
\newcolumntype{m}{>{\hsize=.9\hsize}X}

\begin{table}[!ht]
\setlength\extrarowheight{2pt} % for a bit of visual "breathing space"
\begin{tabularx}{\linewidth}{|s| s| b|}
\hline
\textbf{Score} & \textbf{ Description } & \textbf{Assessment criteria}  \\\hline
1 & Description 1 & Really long description that is longer than 3 lines  \\
\hline
2 &  Description 2 & Really long description that is longer than 3 lines    \\
\hline
3 & Description 3  &  Really long description that is longer than 3 lines\\
\hline
4 & Description 4 &  Really long description that is longer than 3 lines \\
\hline
5 &  Description 5 &Really long description that is longer than 3 lines \\
\hline
\end{tabularx}
\caption{Criteria used}
\end{table}

这是我得到的结果: 结果

我如何删除右侧的额外列并使列描述更宽以适合其列?我尝试更改列宽的值,但它不起作用,我得到相同的结果。

编辑:我正在使用ACM latex模板,即acmart文档类。

编辑2:我在使用了@David Calisle 和@daleif 的建议后得到了这张图片

在此处输入图片描述

答案1

我会按照以下方式编写您的表格:

\documentclass[twocolumn]{article}
\usepackage{ragged2e}
\usepackage{tabularx}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X} 

\usepackage{lipsum}

\begin{document}
    \begin{table}[ht]
    \setlength\extrarowheight{2pt} % for a bit of visual "breathing space"
    \setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{|c|l|L|}
\hline
\textbf{Score} & \textbf{Description } & \textbf{Assessment criteria}  \\\hline
1 & Description 1 & Really long description that is longer than 3 lines  \\
\hline
2 &  Description 2 & Really long description that is longer than 3 lines    \\
\hline
3 & Description 3  &  Really long description that is longer than 3 lines\\
\hline
4 & Description 4 &  Really long description that is longer than 3 lines \\
\hline
5 &  Description 5 &Really long description that is longer than 3 lines \\
\hline
\end{tabularx}
\caption{Criteria used}
    \end{table}
\lipsum[1]
\end{document}}

在此处输入图片描述

相关内容