# How do i put text between multiple columns of a table

I'm currently trying to write up a table for coset enumeration based on Todd-Coxeter. The point of which is that I need a table with letters in the heading falling between each column. Looking around I've found how to do this for the first two columns but can't make it work between each column within the table. I found this question that begins to answer the question but I need it between every comlumn. I currently have this code but don't seem to know how to iterate it for between every column. So I need a letter between each column in the table shown below for each generator i'm working with

\begin{tabular}{cccccc}
\rlap{\kern\tabcolsep\makebox[0pt]{a}}\\
\hline
1&2&3&4&5&1 \\
\hline
\end{tabular}


I hope that you guys can help i'd appreciate any insights, i've been faffing with it for ages

• does the answer below satisfy the requirement – js bibra Apr 7 at 15:06
• @jsbibra I like Steven B. Segletes answer. – Peter Wilson Apr 7 at 17:39

Here, I use a top-right-lap \trlap with a specified width of 2\tabcolsep, so as to center the lap between columns. The vertical position of the lap can be reset with \setstackgap{L}{<baselineskip offset of lap>}.

Therefore, the column separation of the underlying table will not be affected, regardless of the actual text width of the \Jots. Instead, the \Jots would overlap, unless \tabcolsep is increased.

\documentclass{article}
\usepackage{stackengine}
\newcommand\Jot[1]{\smash{\trlap{\makebox[2\tabcolsep]{#1}}}}
\begin{document}
\begin{tabular}{cccccc}
\hline
1\Jot{A}&2\Jot{BB}&3\Jot{C}&4\Jot{D}&5&1 \\
\hline
\end{tabular}
\end{document}


\documentclass[12pt,a4paper]{article}
\usepackage{booktabs}

\begin{document}

\begin{tabular}{cccccc}
\multicolumn{2}{c}{z}&\multicolumn{2}{c}{z}&\multicolumn{2}{c}{z}\\
\toprule
1&2&3&4&5&1 \\
\bottomrule
\end{tabular}

\end{document}


An easy workaround would be to double the number of cells in each row, like this.

\documentclass{article}
\begin{document}
\begin{tabular}{*{11}{c@{\,}}}
& a && b && c && d && e \\
\hline
1 && 2 && 3 && 4 && 5 && 1 \\
\hline
\end{tabular}
\end{document}