3

I need to reproduce the following table using LaTeX.

Needed LaTeX table

I've tried to use a custom column separator, like @{$\oplus$}, but it affect every line of the table and that is not what I need.

\begin{tabular}{|c@{+}c@{=}c@{+}c@{=}c@{+}c@{+}c|}
    \hline
    cell & cell & cell & cell & cell & cell & cell \\
    \hline
    cell & cell & cell & cell & cell & cell & cell \\
    cell & cell & cell & cell & cell & cell & cell \\
    \hline
\end{tabular}

I would like to be able to use a math symbol in place of + or =, like \oplus.

3

enter image description here

\documentclass{article}

\usepackage{array}

\begin{document}

\setlength\extrarowheight{2pt}
\begin{tabular}{|*{7}{c|}}
    \hline
  \multicolumn{1}{|c!{\makebox[0pt]{$+$}}}{cell}&
  \multicolumn{1}{c!{\makebox[0pt]{$=$}}}{cell}&
  \multicolumn{1}{c!{\makebox[0pt]{$+$}}}{cell}&
  \multicolumn{1}{c!{\makebox[0pt]{$=$}}}{cell}&
  \multicolumn{1}{c!{\makebox[0pt]{$+$}}}{cell}&
  \multicolumn{1}{c!{\makebox[0pt]{$+$}}}{cell}&
  \multicolumn{1}{c|}{cell}\\
    \hline
    cell & cell & cell & cell & cell & cell & cell \\
    cell & cell & cell & cell & cell & cell & cell \\
    \hline
\end{tabular}
\end{document}
| improve this answer | |
  • Thank you very much. Subsidiary question: What is the purpose of the \makebox[0pt] command? – John Doe Mar 5 '17 at 17:12
  • 1
    @TomBarthe try it without:-) the content of ! (or @) is at the right hand edge of the previous cell, so if you just did + it would look as if it was to the left of the vertical rule below. \makebox forces it to have zero width overprinting the cell padding on either side so it sits over the | (but put in ++++++ and it will overprint the cell contents with no warning unless you increase \tabcolsep to leave more room. – David Carlisle Mar 5 '17 at 17:16
0

The first table is cleaner, the second table is with the obnoxious vertical rules.

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{tabular}{ c *{6}{@{$\mskip\thickmuskip$}c@{$\mskip\thickmuskip$}c} }
\toprule
cell & $+$ & cell & $=$ & cell & $+$ & cell & $=$ & cell & $+$ & cell & $+$ & cell \\
\midrule
cell && cell && cell && cell && cell && cell && cell \\
cell && cell && cell && cell && cell && cell && cell \\
\bottomrule
\end{tabular}

\bigskip

\begin{tabular}{ |c *{6}{@{$\mskip\thickmuskip$}c@{$\mskip\thickmuskip$}c}| }
\hline
cell & $+$ & cell & $=$ & cell & $+$ & cell & $=$ & cell & $+$ & cell & $+$ & cell \\
\hline
cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell \\
\hline
cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell &\vline& cell \\
\hline
\end{tabular}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.