Table with vertical text, and \multicolumn

Another nicematrix!

Not a surprise: the nicematrix package by itself provides all the necessary elements for this table. Moreover, the code is clean and simple.

Frankly, I like a tool that allows me to spend more time filling in content than formatting.

The main command used, \Block, allows the identification and format of the multi row/column cells. (The command \Block{} creates a monoblock cell that allows the use of \\ inside, thus cutting the line where you want it instead of relying on the width of the column. See the before the last row.)

Notice that all cell are vertically centered.

The package requires two compilations (when the formatting is changed), which is sometimes mentioned as inconvenient. It is not if you develop the table in a separate file and then put the file in the main document in the final stages.

x3

\documentclass{article}

\usepackage{nicematrix}

\begin{document}    

\begin{NiceTabular}{|wc{25pt}wc{25pt} wc{25pt} wc{25pt} |l|}[%
    cell-space-top-limit = 7pt,
    cell-space-bottom-limit = 7pt,
    code-before = \rectanglecolor{gray!15}{1-1}{4-1},
    code-before = \rectanglecolor{gray!15}{4-2}{7-2},
    code-before = \rectanglecolor{gray!15}{7-3}{11-3},
    code-before = \rectanglecolor{gray!15}{11-4}{17-4}, 
    ]
     \hline
    \rotate\Block[draw=black]{4-1}{\bfseries Household} & \Block{3-1}{}& \Block{6-1}{} & \Block{10-1}{} & Peer pressure/prestige among parents\\\cline{5-5}
    & & & & Economic status \\\cline{5-5}
    & & & & Value placed on education\\\cline{5-5}
    &\rotate \Block[draw=black]{4-1}{\bfseries Child  }& & & Aspirations \\\cline{5-5}
    \Block{9-1}{}&  & & & Ability \\\cline{5-5}
    & & & & Academic performance \\\cline{5-5}
    & &\rotate\Block[draw=black]{5-1}{\bfseries Schooling/  teaching quality}& & Exam-orientation, emphasis on scores \\\cline{5-5}
    & \Block{6-1}{} & & & Inadequacy of schooling \\\cline{5-5}
    & & & & \Block{}{Burden od non--academic tasks on \\ teachers} \\\cline{5-5}
    & & & &  \Block{}{Recruitment/promotion unlinked to \\teaching performance} \\\cline{5-5}
    & & &\rotate\Block[draw=black]{3-1}{\bfseries Cultural/ \\ \bfseries other factors}  & Direct shirking/corruption by teachers \\\cline{5-5}
    & &  \Block{2-1}{} & & \Block{}{Labour market premium for elite \\ colleges/professions} \\\cline{5-5}
    & & & &  Herd mentality \\
     \hline
\end{NiceTabular}

\end{document}

With the help of nicematrix (needs version 5.8):

enter image description here

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\noindent
\NiceMatrixOptions{cell-space-top-limit = 3pt,cell-space-bottom-limit = 3pt}
\begin{NiceTabular}{c c c c | p{7.25cm}|}
\cline{5-5}
\Block[fill=lightgray, draw=black]{4-1}{\rotate Household}  & &  &                      & Peer pressure/prestige among parents                   \\ \cline{5-5}
   & & &                                                                                & Economic status                                        \\ \cline{5-5}
   & & &                                                                                & Value placed on education                              \\ \cline{5-5}
   & \Block[fill=lightgray, draw=black]{4-1}{\rotate Child} & &                         & Aspirations                                            \\ \cline{5-5}
   & & &                                                                                & Ability                                                \\ \cline{5-5}
   & & &                                                                                & Academic performance                                   \\ \cline{5-5}
   & & \Block[fill=lightgray, draw=black]{5-1}{\rotate Schooling/\\ teaching quality} & & Exam-orientation, emphasis on scores                   \\ \cline{5-5}
   & & &                                                                                & Inadequacy of schooling                                \\ \cline{5-5}
   & & &                                                                                & Burden of non-academic tasks on teachers               \\ \cline{5-5}
   & & &                                                                                & Recruitment/promotion unlinked to teaching performance \\ \cline{5-5} 
   & & & \Block[fill=lightgray, draw=black]{3-1}{\rotate Cultural/\\ other factors}     & Direct shirking/corruption by teachers                 \\ \cline{5-5}
   & & &                                                                                & Labour market premium for elite colleges/professions   \\ \cline{5-5}
   & & &                                                                                & Herd mentality                                         \\ \cline{5-5}
\end{NiceTabular}
\end{document}

This answer is a small variation of leandriis' answer. I have used the key hvlines (provided by nicematrix) to draw all the rules. Since I don't want interior rules in the first four columns, I have put a global \Block for these four columns: \Block{-4}{} (the syntax -4 means ?-4 that is to say 4 columns and all the remaining rows).

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\noindent
\NiceMatrixOptions{cell-space-top-limit = 3pt,cell-space-bottom-limit = 3pt}
\begin{NiceTabular}{c c c c >{\arraybackslash}p{7.25cm}}[hvlines]
\Block{-4}{}
\Block[fill=lightgray, draw=black]{4-1}{\rotate Household}  & &  &                      & Peer pressure/prestige among parents                   \\
   & & &                                                                                & Economic status                                        \\
   & & &                                                                                & Value placed on education                              \\
   & \Block[fill=lightgray, draw=black]{4-1}{\rotate Child} & &                         & Aspirations                                            \\
   & & &                                                                                & Ability                                                \\
   & & &                                                                                & Academic performance                                   \\
   & & \Block[fill=lightgray, draw=black]{5-1}{\rotate Schooling/\\ teaching quality} & & Exam-orientation, emphasis on scores                   \\
   & & &                                                                                & Inadequacy of schooling                                \\
   & & &                                                                                & Burden of non-academic tasks on teachers               \\
   & & &                                                                                & Recruitment/promotion unlinked to teaching performance \\ 
   & & & \Block[fill=lightgray, draw=black]{3-1}{\rotate Cultural/\\ other factors}     & Direct shirking/corruption by teachers                 \\
   & & &                                                                                & Labour market premium for elite colleges/professions   \\
   & & &                                                                                & Herd mentality                                         \\
\end{NiceTabular}
\end{document}

Output of the above code

Tags:

Tables