# How to fix the column width of my table? [duplicate]

Sorry I have deleted the text in the table (since it would be seen as plagiarism (on my thesis, I can publish it).

Here is my code. I have tried to use \begin{tabular}{|c|c{3in}|c|} in order to fix the second column width but it does not work :

\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}


## marked as duplicate by Schweinebacke, Moriambar, Stefan Pinnow, ebosi, KurtMay 11 '17 at 16:11

• Welcome to TeX.SX! You seem to be missing an \end{table} before the second \begin{table} – Dai Bowen May 11 '17 at 10:11
• @DaiBowen yeah soory when I have copied it I forgot but it exists already, the problem is in the length of second column for the first and second table I would like to make them same large .. – magda May 11 '17 at 10:17
• I have tried as I said the \begin{tabular}{|c|c{3in}|c|} as in the link but it does not work, I am pretty new on latex I did not understand why it does not work – magda May 11 '17 at 10:37
• Look at the content of the answers in the linked questions, not the questions themselves (they are the same as yours I believe). The c column-type does not support taking a length, you need to utilise a different column-type which does, and adapt that to centering for example \begin{tabular}{| c | >{\centering}m{5cm} | c |} as in Jake's answer (you will need to load the array package in order to get the m column type). – Dai Bowen May 11 '17 at 10:41

Or, lets compare with 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}