[Tex/LaTex] How to merge cells vertically

tables

Is it possible to create a table like this one?

enter image description here

The usual structure of tables I use looks like this:

\begin{table}[H]
    \begin{adjustbox}{width=\textwidth,center}
    % \begin{adjustbox}{center}
        \begin{tabular}{lll}
            \hline
            \multicolumn{1}{l}{\head{XXX}} & \multicolumn{1}{l}{\head{XXX}} & \multicolumn{1}{l}{\head{XXX}} \\
            \hline
            \ttfamily xxx & \ttfamily xxx & \ttfamily xxx \\
            \hline
        \end{tabular}
    \end{adjustbox}
    \vspace{ - 05 mm}
    \caption{xxx}
    \label{tab:xxx}
\end{table}

Best Answer

You can use multirow If you are trying to align four rows of a particular column, put

\multirow{4}{*}{XXX}

in the first row and leave three subsequent rows below empty like

\multirow{4}{*}{XXX} &
                     &
                     &
                     &

Then the contents are vertically aligned.

\documentclass[a4paper,12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{adjustbox}
\usepackage{multirow}

\begin{document}
\begin{table}[h]
\centering
%     \begin{adjustbox}{width=\textwidth,center}
    % \begin{adjustbox}{center}
        \begin{tabular}{lll}
            \hline
            \multirow{4}{*}{XXX} & \multicolumn{1}{l}{XXX} & \multicolumn{1}{l}{XXX} \\\cline{2-3}
                                 & \multicolumn{1}{l}{XXX} & \multicolumn{1}{l}{XXX} \\\cline{2-3}
                                 & \multicolumn{1}{l}{XXX} & \multicolumn{1}{l}{XXX} \\\cline{2-3}
                                 & \multicolumn{1}{l}{XXX} & \multicolumn{1}{l}{XXX} \\\hline
            \ttfamily xxx & \ttfamily xxx & \ttfamily xxx \\                \hline
        \end{tabular}
%     \end{adjustbox}
%     \vspace{ - 05 mm}
    \caption{xxx}
    \label{tab:xxx}
\end{table}


\end{document}

enter image description here

Related Question