[Tex/LaTex] Addition and Multiplication Tables

tables

I am trying to create addition and multiplication tables for certain bases, but I want to construct them in a way different than most addition/multiplication tables are made, where the line divisions occur all throughout the table. I am trying to replicate exactly this (but to be able to extend it to whatever size array I want):

enter image description here

I see the following can produce one table easily:

\begin{center}
\begin{tabular}{ c| c | c | c | c |}
+ & 0 & 1 & 2 & 3 \\
\hline
0 & 0 & 1 & 2 & 3 \\ 
\hline
1 & 1 & 2 & 3 & 10 \\ 
\hline
2 & 2 & 3 & 10 & 11 \\ 
\hline
3 & 3 & 10 & 11 & 12 \\ 
\hline
\end{tabular}
\end{center}

How might I actually make the spacing uniform though (the numbers appear to be "lifted" a bit and not in the center of their respective boxes)? Also, how might I increase the spacing within each box?

Best Answer

Starting from your table, I'd use a decimal alignment column rather than c to ensure columns are equal width and o make the numbers line up correctly, and perhaps use thicker rules for the first row and column:

enter image description here

\documentclass{article}

\usepackage{dcolumn}
\newcolumntype{2}{D{.}{}{2.0}}
\begin{document}


\begin{center}
\renewcommand\arraystretch{1.3}
\setlength\doublerulesep{0pt}
\begin{tabular}{r||*{4}{2|}}
+ & 0 & 1 & 2 & 3 \\
\hline\hline
0 & 0 & 1 & 2 & 3 \\ 
\hline
1 & 1 & 2 & 3 & 10 \\ 
\hline
2 & 2 & 3 & 10 & 11 \\ 
\hline
3 & 3 & 10 & 11 & 12 \\ 
\hline
\end{tabular}
\end{center}

\end{document}
Related Question