如何删除每行末尾的多余空格?我希望表格在最后一列之后立即结束,然后居中。
\begin{table}[]
\centering
\footnotesize
\linespread{1}\selectfont
\begin{center}
\begin{tabularx}{\linewidth}{x x x x x x x}
\toprule
\textbf{Number of Validators} & x & x & x & x & x & x \\
\midrule
\textbf{Number of Shards} & x & x & x & x & x & x \\
\midrule
\textbf{Size of shards} & x & x & x & x & x & x \\
\bottomrule
\end{tabularx}
\end{center}
\caption{Setup with the size of each shard fixed.} \label{table:shards}
\end{table}
答案1
没有理由使用它tabularx
作为您的表格。为什么不直接使用普通的tabular
第 i 列ccccccc
?
\begin{tabular}{ccccccc}
\toprule
\textbf{Number of Validators} & x & x & x & x & x & x \\
\midrule
\textbf{Number of Shards} & x & x & x & x & x & x \\
\midrule
\textbf{Size of shards} & x & x & x & x & x & x \\
\bottomrule
\end{tabular}