0

How can I make the following table in LaTeX?

enter image description here

Werner
  • 603,163
  • There is more than one way of doing this. Voted for reopen. – percusse Oct 07 '14 at 00:20
  • 5
    @percusse since that is the case, shouldn't the additionally answer be added to original post for greater continuity when searching? – dustin Oct 07 '14 at 01:23
  • @LuGeorge Welcome to TeX.SX! It would be nice if you always post a minimal example document and if you ask specific questions. Where are you having problems here? There are many posts on this site explaining how to do such a table. – LaRiFaRi Oct 07 '14 at 06:13
  • @dustin Yes it is an option but not all questions are amenable to being the central hub for a certain function. The questions are linked now anyways. – percusse Oct 07 '14 at 08:46

2 Answers2

4

Here is an option without using any packages:

enter image description here

\documentclass{article}
\begin{document}
\begin{tabular}{|*{6}{c|}}
  \hline
  & 1 & 276 & & \multicolumn{2}{c|}{letters} \\
  \cline{2-3}\cline{5-6}
  \raisebox{.5\normalbaselineskip}[0pt][0pt]{A} & 
    \multicolumn{2}{c|}{numbers} & 
    \raisebox{.5\normalbaselineskip}[0pt][0pt]{B} &
    a b c &
    A B C \\
    \hline
\end{tabular}
\end{document} 

Instead of moving the letters A and B "up" into position in the middle of the two rows, one can also move then "down":

\documentclass{article}
\begin{document}
\begin{tabular}{|*{6}{c|}}
  \hline
  \raisebox{-.5\normalbaselineskip}[0pt][0pt]{A} & 1 & 276 & 
    \raisebox{-.5\normalbaselineskip}[0pt][0pt]{B} & \multicolumn{2}{c|}{letters} \\
  \cline{2-3}\cline{5-6}
  & \multicolumn{2}{c|}{numbers} & & a b c & A B C \\
    \hline
\end{tabular}
\end{document} 

Alternatively, one can also use multirow's functionality via \multirow{2}{*}{<stuff>} (or \multirow{-2}{*}{<stuff>}) in a similar manner to the above solutions.

Werner
  • 603,163
2

Here is one more possibility to do it without any package. And I also added the most typical (and mentioned by Werner) version with multirow, which can be found all over the place on TeX.SX.

% arara: pdflatex

\documentclass{article}
\usepackage{multirow} % just needed for the second solution

\begin{document}    
    \begin{tabular}{|c|@{}c@{}|c|@{}c@{}|}\hline
        A &
        \begin{tabular}{c|c}
            1 & 276\\\hline
            \multicolumn{2}{c}{numbers}
        \end{tabular} &
        B &
        \begin{tabular}{c|c}
            \multicolumn{2}{c}{letters}\\\hline
            a b c & A B C\\
        \end{tabular}\\\hline
    \end{tabular}

    \begin{tabular}{|*{6}{c|}}\hline
        \multirow{2}{*}{A} & 1 & 276 & \multirow{2}{*}{B} & \multicolumn{2}{c|}{letters}\\\cline{2-3}\cline{5-6}
        & \multicolumn{2}{c|}{numbers} & & a b c & A B C\\\hline
    \end{tabular}   
\end{document}

enter image description here

LaRiFaRi
  • 43,807