0

I am trying to fit a wide table in my document. I am using the tabularx option for the table. Could someone help me out on how I can fit this wide table.

The code for my table is

\begin{table}[H]

\caption{Work Roll Dimensions \cite{drawingarchive}}

\label{tab:workrolldimension}

\begin{tabularx}{500pt}{|l|l|l|l|l|l|l|l|l|l|}

\hline

\textbf{\begin{tabular}[c]{@{}l@{}}Stand \ No.\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}Groove \ Shape\end{tabular}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Height\ (Depth)\ Hg\ mm\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Groove \ Angle\ ag\ °\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Relief \ Radius\ R0\ mm\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Bottom\ Radius\ R1\ mm\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Bottom\ Radius \ R2\ mm\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Width \ at \ collar\ Wg\ mm\end{tabular}}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Top \ Width \ Wt\ mm\end{tabular}}} & \multicolumn{1}{c|}

{\textbf{\begin{tabular}[c]{@{}c@{}}Roll\ Dia\ D\ mm\end{tabular}}}\ \hline

0 & Box & 35 & 16.5 & 10 & 20 & - & 154.09 & 133.35 & 560\ \hline

1 & Box Oval & 40 & 19.5 & 10 & 20 & 180 & 108.51 & 85.45 & 530\ \hline

2 & Oval & 28.5 & - & 10 & 130 & - & - & - & 505\ \hline

3 & Round & 33 & 60 & 8 & 41 & - & 85.45 & - & 460\ \hline

4 & Oval & 21.426 & - & 10 & 71.554 & - & - & - & 460\ \hline

\end{tabularx}

\end{table}

Output

I need to make sure that the table is fitted within the margin line at the top of the page.

I look forward to your support.

Thanks in advance

Anant
  • 1
  • 3
    \begin{tabularx}{500pt}{|l|l|l|l|l|l|l|l|l|l|} tabularx always needs at least one X column, otherwise it can do nothing useful. – David Carlisle Apr 25 '22 at 11:48
  • 2
    You have not provided an example that we can use for testing (in particular no indication of the page size) but use tabular not tabularx so the table is natural width, then you could use \small or whatever size is needed to make it fit, otherwise see the answers to https://tex.stackexchange.com/questions/332902/my-table-doesnt-fit-what-are-my-options – David Carlisle Apr 25 '22 at 11:54
  • @DavidCarlisle the size of the page is a4 – Anant Apr 25 '22 at 12:02

1 Answers1

1

A couple of solutions with tabularray.

Please note that you don't need to add other tabulars to format the headers:

\documentclass[a4paper]{book}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\usepackage{caption} \usepackage{float}

\begin{document} \begin{table}[H]\small\centering \caption{Work Roll Dimensions XXX}\label{tab:workrolldimension} \begin{tblr}{ colspec={cX*{8}{c}}, width=\textwidth, row{1}={m, c, font=\bfseries}, hlines, vlines, colsep=4.7pt } {Stand\ No.} & {Groove \ Shape} & {Height\ (Depth)\ Hg\ mm} & {Groove \ Angle\ ag\ °} & {Relief \ Radius\ R0\ mm} & {Bottom\ Radius\ R1\ mm} & {Bottom\ Radius \ R2\ mm} & {Width \ at \ collar\ Wg\ mm} & {Top \ Width \ Wt\ mm} & {Roll\ Dia\ D\ mm}\ 0 & Box & 35 & 16.5 & 10 & 20 & - & 154.09 & 133.35 & 560\ 1 & Box Oval & 40 & 19.5 & 10 & 20 & 180 & 108.51 & 85.45 & 530\ 2 & Oval & 28.5 & - & 10 & 130 & - & - & - & 505\ 3 & Round & 33 & 60 & 8 & 41 & - & 85.45 & - & 460\ 4 & Oval & 21.426 & - & 10 & 71.554 & - & - & - & 460\ \end{tblr} \end{table}

Or, more professional, without vertical rules:

\begin{table}[H]\small\centering \caption{Work Roll Dimensions XXX}\label{tab:workrolldimension} \begin{tblr}{ colspec={cX[c]*{8}{c}}, width=\textwidth, row{1}={m, c, font=\bfseries}, colsep=4.7pt } \toprule {Stand\ No.} & {Groove \ Shape} & {Height\ (Depth)\ Hg\ mm} & {Groove \ Angle\ ag\ °} & {Relief \ Radius\ R0\ mm} & {Bottom\ Radius\ R1\ mm} & {Bottom\ Radius \ R2\ mm} & {Width \ at \ collar\ Wg\ mm} & {Top \ Width \ Wt\ mm} & {Roll\ Dia\ D\ mm}\ \midrule 0 & Box & 35 & 16.5 & 10 & 20 & - & 154.09 & 133.35 & 560\ 1 & Box Oval & 40 & 19.5 & 10 & 20 & 180 & 108.51 & 85.45 & 530\ 2 & Oval & 28.5 & - & 10 & 130 & - & - & - & 505\ 3 & Round & 33 & 60 & 8 & 41 & - & 85.45 & - & 460\ 4 & Oval & 21.426 & - & 10 & 71.554 & - & - & - & 460\ \bottomrule \end{tblr} \end{table} \end{document}

enter image description here

CarLaTeX
  • 62,716