[Tex/LaTex] Fit large table horizontally into a page

tables

I have a table with 23 columns. How can I fit it to the page?

Code:

\usepackage[verbose]{placeins}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
    \begin{table}[htbf]
    \caption{Gross errors found using plausible value check}
    \label{tab:gr}
    \begin{center}
        \begin{tabular*}{0.75\textwidth}{@{\extracolsep{\fill}}  l  c  c c c c c c c c c c c c c c c c c c c c c c  }
           \toprule
             \textbf{Node Name} &\textbf{Node 2} &\textbf{Node 3} &\textbf{Node 4} &\textbf{Node 5} &\textbf{Node 6} &\textbf{Node 7} &\textbf{Node 8} &\textbf{Node 9} &\textbf{Node 10} &\textbf{Node 11} &\textbf{Node 12} &\textbf{Node 13} &\textbf{Node 14} &\textbf{Node 15} &\textbf{Node 17} &\textbf{Node 18} &\textbf{Node 19} &\textbf{Node 20} &\textbf{Node 25} &\textbf{Node 28} &\textbf{Node 29} &\textbf{Node 31} &\textbf{Node 32} \\
           \midrule
             \textbf{Total Number Observations} 33 & 34 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33  \\
             \textbf{Number of Faults} & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33  \\

           \bottomrule
        \end{tabular*}
    \end{center}
\end{table}
\FloatBarrier
\blindtext

Result:
Result of the code Result of the code

Best Answer

You can try and spare on intercolumn spaces, by locally reducing the value of \tabcolsep; also the headers should be as short as possible.

\documentclass{article}

\usepackage[pass,showframe]{geometry} % just to show the margins
\usepackage{booktabs}

\begin{document}

Here is a table

\begin{table}[htp]
\centering
\footnotesize\setlength{\tabcolsep}{2.5pt}
\begin{tabular}{l@{\hspace{6pt}} *{22}{c}}
\toprule
\bfseries Type & \multicolumn{22}{c}{\bfseries Node name} \\
\cmidrule(l){2-23}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 \\
\midrule
\bfseries A
& 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33
& 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 \\
\bfseries B
& 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33
& 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 & 33 \\
\bottomrule
\addlinespace
\multicolumn{23}{l}{A: Total number of observations}\\
\multicolumn{23}{l}{B: Number of faults}
\end{tabular}
\caption{Observations}\label{tab:observ}
\end{table}
\end{document}

enter image description here

Related Question