4

I would like to create a tabular of the form

enter image description here

So far I have achieved

        \begin{tabular}{ |c|c|c|c|c| c }
            \cline{1-5}
            cell1 & cell2 & cell3 & cell4 & cell5 & 11 \\
            \cline{1-5}
            cell6 & cell7 & cell8 & cell9 & cell10 & 12 \\
            \cline{1-5}
            cell11 & cell12 & cell13 & cell14 & cell15 & 7 \\
            \cline{1-5}
            6 & 6 & 3 & 2 & 13 \\
        \end{tabular}

which gets me this

enter image description here

not quite what I want to. I guess I have to use the \multicolumn command, but I am not sure how. Any hints?

1 Answer 1

5

With a custom command based on \multicolumn{1}{c}:

enter image description here

\documentclass{article}
\newcommand{\mymc}[1]{\multicolumn{1}{c}{#1}}
\begin{document}

\begin{tabular}{ |c|c|c|c|c| c }
            \cline{1-5}
            cell1 & cell2 & cell3 & cell4 & cell5 & 11 \\
            \cline{1-5}
            cell6 & cell7 & cell8 & cell9 & cell10 & 12 \\
            \cline{1-5}
            cell11 & cell12 & cell13 & cell14 & cell15 & 7 \\
            \cline{1-5}
            \mymc{6} & \mymc{6} & \mymc{3} & \mymc{2} & \mymc{13} \\
\end{tabular}
        
\end{document}
1
  • Thank you very much! That is exactly what I wanted!
    – AndrewSpan
    Commented Dec 14, 2020 at 21:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .