# Is it possible to make a 9x9 table fit within the default margins?

so I have the following code:

\begin{align*}
\setlength\extrarowheight{3pt}
\noindent\begin{tabular}{c | c c c c c c c c }
+  & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$\\
\cline{1-9}
$(0,0,0)$ & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$\\
$(0,0,1)$ & $(0,0,1)$ & $(0,0,0)$ & $(0,1,1)$ & $(0,1,0)$ & $(1,0,1)$ & $(1,0,0)$ & $(1,1,1)$ & $(1,1,0)$\\
$(0,1,0)$ & $(0,1,0)$ & $(0,1,1)$ & $(0,0,0)$ & $(0,0,1)$ & $(1,1,0)$ & $(1,1,1)$ & $(1,0,0)$ & $(1,0,1)$\\
$(0,1,1)$ & $(0,1,1)$ & $(0,1,0)$ & $(0,0,1)$ & $(0,0,0)$ & $(1,1,1)$ & $(1,1,0)$ & $(1,0,1)$ & $(1,0,0)$\\
$(1,0,0)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$ & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$\\
$(1,0,1)$ & $(1,0,1)$ & $(1,0,0)$ & $(1,1,1)$ & $(1,1,0)$ & $(0,0,1)$ & $(0,0,0)$ & $(0,1,1)$ & $(0,1,0)$\\
$(1,1,0)$ & $(1,1,0)$ & $(1,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(0,0,0)$ & $(0,0,1)$\\
$(1,1,1)$ & $(1,1,1)$ & $(1,1,0)$ & $(1,0,1)$ & $(1,0,0)$ & $(0,1,1)$ & $(0,1,0)$ & $(0,0,1)$ & $(0,0,0)$\\
\end{tabular}
\end{align*}

The character table:

\documentclass[11pt, a4paper]{report}
\usepackage{bm}
\usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{setspace}% if you must (for double spacing thesis)
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{lipsum}
\usepackage{floatrow}

\begin{document}
\begin{align*}
\setlength\extrarowheight{3pt}
\noindent\begin{tabular}{c | c c c c c c c c }
+  & $(0,0,0)$ & $(0,0,1)$ & $(0,1,0)$ & $(0,1,1)$ & $(1,0,0)$ & $(1,0,1)$ & $(1,1,0)$ & $(1,1,1)$\\
\cline{1-9}
$\chi_{(0,0,0)}$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$\\
$\chi_{(0,0,1)}$ & $1$ & $1$ & $1$ & $1$ & $-1$ & $-1$ & $-1$ & $-1$\\
$\chi_{(0,1,0)}$ & $1$ & $1$ & $-1$ & $-1$ & $1$ & $1$ & $-1$ & $-1$\\
$\chi_{(0,1,1)}$ & $1$ & $1$ & $-1$ & $-1$ & $-1$ & $-1$ & $1$ & $1$\\
$\chi_{(1,0,0)}$ & $1$ & $-1$ & $1$ & $-1$ & $1$ & $-1$ & $1$ & $-1$\\
$\chi_{(1,0,1)}$ & $1$ & $-1$ & $1$ & $-1$ & $-1$ & $1$ & $-1$ & $1$\\
$\chi_{(1,1,0)}$ & $1$ & $-1$ & $-1$ & $1$ & $1$ & $-1$ & $-1$ & $1$\\
$\chi_{(1,1,1)}$ & $1$ & $-1$ & $-1$ & $1$ & $-1$ & $1$ & $1$ & $-1$\\
\end{tabular}
\end{align*}
\end{document}


Using the default margins, it goes beyond the dimensions of the default margins which doesn't make it consistent with the rest of the document, any fixes?

\end{tabular}
\end{align*}
}
\end{document}


• Thanks, can you do something similar for the table above? – Maths Apr 1 '19 at 15:40
• well its the same additional line, but this makes the first table look very compact – Maths Apr 1 '19 at 15:42
• @Maths You can set it differently for each table. In the latter case, you might consider setting the tabular in a smaller font size. – Steven B. Segletes Apr 1 '19 at 15:51

I would recommend array for that.

\documentclass[11pt, a4paper]{report}
\usepackage{bm}
\usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{setspace}% if you must (for double spacing thesis)
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{lipsum}
\usepackage{floatrow}
\begin{document}
$\setlength\extrarowheight{3pt} \begin{array}{@{}c|c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{}} + & (0,0,0) & (0,0,1) & (0,1,0) & (0,1,1) & (1,0,0) & (1,0,1) & (1,1,0) & (1,1,1)\\ \hline \chi_{(0,0,0)} & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1\\ \chi_{(0,0,1)} & 1 & 1 & 1 & 1 & -1 & -1 & -1 & -1\\ \chi_{(0,1,0)} & 1 & 1 & -1 & -1 & 1 & 1 & -1 & -1\\ \chi_{(0,1,1)} & 1 & 1 & -1 & -1 & -1 & -1 & 1 & 1\\ \chi_{(1,0,0)} & 1 & -1 & 1 & -1 & 1 & -1 & 1 & -1\\ \chi_{(1,0,1)} & 1 & -1 & 1 & -1 & -1 & 1 & -1 & 1\\ \chi_{(1,1,0)} & 1 & -1 & -1 & 1 & 1 & -1 & -1 & 1\\ \chi_{(1,1,1)} & 1 & -1 & -1 & 1 & -1 & 1 & 1 & -1 \end{array}$
\end{document}


I prefer these two variants:

\documentclass[11pt, a4paper]{report}
\usepackage{bm}
\usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{setspace}% if you must (for double spacing thesis)
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{lipsum}
\usepackage{floatrow}
\begin{document}
$\setlength\extrarowheight{3pt} \begin{array}{@{}c|c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{}} + & (0,0,0) & (0,0,1) & (0,1,0) & (0,1,1) & (1,0,0) & (1,0,1) & (1,1,0) & (1,1,1)\\ \hline \chi_{(0,0,0)} & +1 & +1 & +1 & +1 & +1 & +1 & +1 & +1\\ \chi_{(0,0,1)} & +1 & +1 & +1 & +1 & -1 & -1 & -1 & -1\\ \chi_{(0,1,0)} & +1 & +1 & -1 & -1 & +1 & +1 & -1 & -1\\ \chi_{(0,1,1)} & +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1\\ \chi_{(1,0,0)} & +1 & -1 & +1 & -1 & +1 & -1 & +1 & -1\\ \chi_{(1,0,1)} & +1 & -1 & +1 & -1 & -1 & +1 & -1 & +1\\ \chi_{(1,1,0)} & +1 & -1 & -1 & +1 & +1 & -1 & -1 & +1\\ \chi_{(1,1,1)} & +1 & -1 & -1 & +1 & -1 & +1 & +1 & -1 \end{array}$
\end{document}


\documentclass[11pt, a4paper]{report}
\usepackage{bm}
\usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{setspace}% if you must (for double spacing thesis)
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{parskip}
\usepackage{lipsum}
\usepackage{floatrow}
\begin{document}
$\setlength\extrarowheight{3pt} \begin{array}{@{}c|c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{\;}c@{}} + & (0,0,0) & (0,0,1) & (0,1,0) & (0,1,1) & (1,0,0) & (1,0,1) & (1,1,0) & (1,1,1)\\ \hline \chi_{(0,0,0)} & 1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1\\ \chi_{(0,0,1)} & 1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1\\ \chi_{(0,1,0)} & 1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1\\ \chi_{(0,1,1)} & 1 & \phantom{-}1 & -1 & -1 & -1 & -1 & \phantom{-}1 & \phantom{-}1\\ \chi_{(1,0,0)} & 1 & -1 & \phantom{-}1 & -1 & \phantom{-}1 & -1 & \phantom{-}1 & -1\\ \chi_{(1,0,1)} & 1 & -1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & -1 & \phantom{-}1\\ \chi_{(1,1,0)} & 1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1\\ \chi_{(1,1,1)} & 1 & -1 & -1 & \phantom{-}1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 \end{array}$
\end{document}


• But will this be within the default margins? as that's my issue – Maths Apr 1 '19 at 15:43
• @Maths Of course yes - I did some settings to make sure that Overfull \hbox doesn't happen. – user156344 Apr 1 '19 at 15:44
• all solutions provided here are of good quality hence the +1 for all. however for the first table, as mentioned in the above answer, using the technique from the first solution makes everything compact, any ideas to make it 'free'? – Maths Apr 1 '19 at 15:49
• @Maths What do you mean by "free"? Automatic resize if margin exceeded? – user156344 Apr 1 '19 at 15:50
• @Mico Oh yes. Actually I used "Find and Replace" in my editor, so I did not take note of that. Thanks! – user156344 Apr 1 '19 at 16:00