質問: I have the following code, however the table does not fit on 1 page as it is a 18x18 table. I tried doing it in landscape, but then it still does not fit on one page. Also I tried to make the font smaller, but this doesn't get the desired result also. My code is the following: ``` \begin{landscape} \begin{scriptsize} \begin{table}[H] \centering \caption{18x18 correlation matrix} \label{} \begin{tabular}{@{\extracolsep{5pt}}lcccccccccccccccccc} \\[-1.8ex]\hline \hline \\[-1.8ex] ..... \hline \\[-1.8ex] \end{tabular} \end{table} \end{scriptsize} \end{landscape} ```
回答: With due apologies to @DavidCarlisle I could not resist adding color !! !enter image description here ``` \documentclass{article} \usepackage{booktabs} \usepackage[table]{xcolor} \makeatletter \newcommand*{\minuscellcolor}{} \def\minuscellcolor\ignorespaces{% % \ignorespaces not really needed, because \@ifnextchar gobbles spaces \@ifnextchar1{\cellcolor{blue!20}}{}% } \newcolumntype{C}{>{\minuscellcolor}c} \makeatother \begin{document} \begin{table} \footnotesize \setlength\tabcolsep{1pt} \centering \begin{tabular}{CCCCCCCCCCCCCCCCCC} \toprule 1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000&0.0000\\ 0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&0.0000&1.0000\\ \bottomrule \end{tabular} \end{table} \end{document} ```