如何修复表格的列宽?

如何修复表格的列宽?

抱歉,我删除了表格中的文本(因为它会被视为抄袭(在我的论文中,我可以发表它)。

在此处输入图片描述

这是我的代码。我尝试使用它\begin{tabular}{|c|c{3in}|c|}来修复第二列的宽度,但是没有用:

\begin{table}[h!]
\centering 
\begin{tabular}{|c|c|c|} 
\hline  & \textbf{Ohjdudfd fhedjeji veghjk} & \textbf{hedfj jddi}  \\

\hline  \textbf{hdiud-d} & 3-7-17-20-6-8-13-16-8-5-12-21-14-19-2-50-15-5-
14-11-1 & 5.62\%\\
\hline  \textbf{kdjd-hk}  & 7-80-16-7-6-87-2-8-83-5-71-4
-77-88-54-9-55-15-18-77-20 & 5.63\% \\
\hline  \textbf{ded ffvfr}  & --- & 74.58\% \\
\hline
\end{tabular}
\caption{Rusdh ohju tje dkjdk djdkd}
\label{table:3}
\end{table}

\begin{table}[h!]
\centering 
\begin{tabular}{|c|c|c|}
\hline  & \textbf{ikji hikk hyhu} & \textbf{bhhy kokol}  \\

\hline  \textbf{njsd-h} & 2-8-3-7-2-8-5-4-4 & 77.30\%\\
\hline  \textbf{hcdh-j}  & 7-6-1-7-3-3-5-4-9 & 02.77\% \\
\hline  \textbf{Conhhjj mehjj}  & --- & 02.56\% \\
\hline
\end{tabular}
\caption{hhi ojj oool juui hjjj}
\label{table:2}
\end{table}

答案1

看着如何创建带有文本“raggedright/centered/raggedleft”的固定宽度表格列?

或者,让我们与 booktabs 进行比较:

\documentclass{amsart}
\usepackage{array}
\usepackage{booktabs}
\begin{document}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{table}[h!]
\centering 
\begin{tabular}{|c|C{3cm}|c|} 
\hline  & \textbf{Ohjdudfd fhedjeji veghjk} & \textbf{hedfj jddi}  \\
\hline  \textbf{hdiud-d} & 3-7-17-20-6-8-13-16-8-5-12-21-14-19-2-50-15-5-14-11-1 & 5.62\%\\
\hline  \textbf{kdjd-hk}  & 7-80-16-7-6-87-2-8-83-5-71-4-77-88-54-9-55-15-18-77-20 & 5.63\% \\
\hline  \textbf{ded ffvfr}  & --- & 74.58\% \\
\hline
\end{tabular}
\caption{Rusdh ohju tje dkjdk djdkd}
\label{table:3}
\end{table}
\begin{table}[h!]
\centering 
\renewcommand*{\arraystretch}{1.5}
\begin{tabular}{cC{3cm}c} 
\toprule
& \textbf{Ohjdudfd fhedjeji veghjk} & \textbf{hedfj jddi}  \\
\midrule
\textbf{hdiud-d} & 3-7-17-20-6-8-13-16-8-5-12-21-14-19-2-50-15-5-14-11-1 & 5.62\% \\
\textbf{kdjd-hk}  & 7-80-16-7-6-87-2-8-83-5-71-4-77-88-54-9-55-15-18-77-20 & 5.63\% \\
\textbf{ded ffvfr}  & --- & 74.58\% \\
\bottomrule
\end{tabular}
\caption{Rusdh ohju tje dkjdk djdkd}
\label{table:3}
\end{table}
\end{document}

表格比较

相关内容