# why my table is too wide? [duplicate]

I have the following table

$\label{Table} \begin{tabularx}{\textwidth}{@{} c>{\hsize=0.5\hsize}C {\hsize=1.5\hsize}C @{} } \toprule Name & Symmetry group & Generators of the group \\ \midrule P1 & Cyclic group$ C_{5} $&$(1,2,3,4,5)$\\ \midrule P2 & Primitive group (15,2) &$ (1,15,7,5,12)(2,9,13,14,8)(3,6,10,11,4),  (1,4,5)(2,8,10)(3,12,15)(6,13,11)(7,9,14)$\\ \midrule P3 & Primitive group (21,2) &$(1,7,12,16,19,21,6)$,$(2,8,13,17,20,5,11)$,$(3,9,14,18,4,10,15)$,$(4,6,5)$,$(9,11,10)$,$(13,15,14)$,$(16,18,17)$,$(19,20,21)$\\ \midrule P4 & Primitive group (45,2) &$ ( 1, 2, 7)( 3,11,27)( 4,14,31)( 5,18,32)( 6,20,36)( 8,24,39)( 9,25,28)(10,26,42)(12,15,16)(13,30,40)(17,19,21)(22,35,44)(23,33,29)(34,43,37)(38,45,41)$,$ ( 1, 3, 5, 6, 7,22,13,23)( 2, 8, 9,10)( 4,15,16,17,14,21,19,12
)(11,28,29,38,44,25,20,37)(18,33,34,24,40,36,41,39)(26,43,35,32,42,45,27,
30)$,$( 1, 4)( 3,12)( 5,19)( 6,21)( 7,14)( 8,10)(11,20)(13,16)(15,23)
(17,22)(18,33)(24,41)(25,28)(26,43)(27,32)(29,44)(30,35)(34,39)(36,40)(42,45) $\\ \bottomrule \end{tabularx} \end{table}$


it is like this in my pdf:

what is wrong?

• Please make your code compilable by adding the documentclass as well as the relevant packages. Please also include the definition of the C type column. Jun 11, 2020 at 9:43
• Why did you add a $ before \label and after \end{table}? Jun 11, 2020 at 9:44 • Do you get any error messages if you try to run your code? Jun 11, 2020 at 9:47 • Please also explain the difference to your previous question tex.stackexchange.com/q/530297/134144. What's wrong with the two answers you already recieved there? Jun 11, 2020 at 9:55 • If I saw correctly, you used the code from Zarko's answer to your previous questions but made some changes which now prevent the code from compiling. To summairze them: Remove the two $ I already mentioned in my previous comment and add the missing > back in that you seem to have deleted accidentally: >{\hsize=1.5\hsize}C instead of {\hsize=1.5\hsize}C. Jun 11, 2020 at 9:59

The surrounding $ symbols are surely a mistake. Here's a possibly simpler way to typeset the table, without guessing at the column widths. \documentclass{article} \usepackage{amsmath} \usepackage{tabularx,booktabs} \begin{document} \begin{table}[htp] % shorthand for easing input in this particular table \newcommand{\desc}[1]{\begin{tabular}[t]{@{}l@{}}#1\end{tabular}} \caption{ILP-feasibility problems}\label{Table-ILP} \begin{tabularx}{\textwidth}{@{} l l >{\raggedright\arraybackslash}X @{}} \toprule Name & \desc{Symmetry \\ group} & Generators of the group \\ \midrule P1 & \desc{Cyclic \\ group \\$C_{5}$} &$(1,2,3,4,5)$\\ \midrule P2 & \desc{Primitive \\ group \\$(15,2)$} &$(1,15,7,5,12)(2,9,13,14,8)(3,6,10,11,4)$,$(1,4,5)(2,8,10)(3,12,15)(6,13,11)(7,9,14)$\\ \midrule P3 & \desc{Primitive \\ group \\$(21,2)$} &$(1,7,12,16,19,21,6)$,$(2,8,13,17,20,5,11)$,$(3,9,14,18,4,10,15)$,$(4,6,5)$,$(9,11,10)$,$(13,15,14)$,$(16,18,17)$,$(19,20,21)$\\ \midrule P4 & \desc{Primitive \\ group \\$(45,2)$} &$(1,2,7)(3,11,27)(4,14,31)(5,18,32)( 6,20,36)(8,24,39)(9,25,28)(10,26,42)(12,15,16)(13,30,40)(17,19,21)(22,35,44)(23,33,29)(34,43,37)(38,45,41)$,$(1,3,5,6,7,22,13,23)(2,8,9,10)(4,15,16,17,14,21,19,12)(11,28,29,38,44,25,20,37)(18,33,34,24,40,36,41,39)(26,43,35,32,42,45,27,30)$,$(1,4)(3,12)(5,19)(6,21)(7,14)(8,10)(11,20)(13,16)(15,23)(17,22)(18,33)(24,41)(25,28)(26,43)(27,32)(29,44)(30,35)(34,39)(36,40)(42,45)$\\ \bottomrule \end{tabularx} \end{table} \end{document}  There is no apparent consistency in placing commas between generators, so fix it. Just for the sake of variety, here's another tabularx-based solution which (a) sets the width of the 2nd column so that the header ("Symmetry Group") just fits and (b) does away with the interior \midrule directives in favor of \addlinespace. Oh, and I assumed that you want the list of generators to be a comma-separated list. \documentclass{article} \usepackage{tabularx,booktabs} \newcolumntype{L}{>{\raggedright\arraybackslash}X} \newlength\mylen \settowidth\mylen{Symmetry Group} % determine width of 2nd column \begin{document} \begin{table}[htbp] \setlength\tabcolsep{4pt} % default value: 6pt \caption{A caption} \label{Table} \begin{tabularx}{\textwidth}{@{} l >{\raggedright}p{\mylen} L @{}} \toprule Name & Symmetry group & Generators of the group \\ \midrule P1 & Cyclic group$ C_{5} $&$(1,2,3,4,5)$\\ \addlinespace P2 & Primitive group (15,2) &$(1,15,7,5,12)$,$(2,9,13,14,8)$,$(3,6,10,11,4)$,$(1,4,5)$,$(2,8,10)$,$(3,12,15)$,$(6,13,11)$,$(7,9,14)$\\ \addlinespace P3 & Primitive group (21,2) &$(1,7,12,16,19,21,6)$,$(2,8,13,17,20,5,11)$,$(3,9,14,18,4,10,15)$,$(4,6,5)$,$(9,11,10)$,$(13,15,14)$,$(16,18,17)$,$(19,20,21)$\\ \addlinespace P4 & Primitive group (45,2) &$(1, 2, 7)$,$(3,11,27)$,$(4,14,31)$,$(5,18,32)$,$(6,20,36)$,$(8,24,39)$,$(9,25,28)$,$(10,26,42)$,$(12,15,16)$,$(13,30,40)$,$(17,19,21)$,$(22,35,44)$,$(23,33,29)$,$(34,43,37)$,$(38,45,41)$,$(1, 3, 5, 6, 7,22,13,23)$,$(2, 8, 9,10)$,$(4,15,16,17,14,21,19,12)$,$(11,28,29,38,44,25,20,37)$,$(18,33,34,24,40,36,41,39)$,$(26,43,35,32,42,45,27, 30)$,$(1, 4)$,$(3,12)$,$(5,19)$,$(6,21)$,$(7,14)$,$(8,10)$,$(11,20)$,$(13,16)$,$(15,23)(17,22)$,$(18,33)$,$(24,41)$,$(25,28)$,$(26,43)$,$(27,32)$,$(29,44)$,$(30,35)$,$(34,39)$,$(36,40)$,$(42,45)\$  \\