[Tex/LaTex] Split cells vertical and horizontal

clinemulticolumnmultirowtablestabularx

enter image description here

I'm an absolute newby in Latex and I try to reproduce a table (see picture above) as an exercise in university. I need to split cells both vertically and horizontally, as can be seen in the picture. Further, I need to give the table a caption. With my code, I can split lines horizontally but for a vertical split, I can't find a solution that is working for me.

\begin{document}
\begin{tabular}
  \hline 
  \multicolumn{2}{|l|}{learning process}  & learning tools & search space  \\
  \hline
  \multicolumn{2}{|l|}{feature engineering}  & (subsequent) classifiers & feature sets   \\
  \cline{3-3} 
  \multicolumn{2}{|l|}{}  &    & feature enhancing methods and their hyper-parameters   \\
  \hline
  \multicolumn{2}{|l|}{model selection}  & classifiers & classifiers and their hyper-parameters   \\
  \hline
  \multicolumn{2}{|l|}{optimization algorithm selection}  & classifiers & algorithms and their hyper-parameters   \\
  \hline
\end{tabular}
\caption{\label{tab:table-name}Caption}
\end{document}

Edit: This is the information I have regarding the type of my document:

%\documentclass[headsepline,footsepline,footinclude=false,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc,BCOR=12mm,DIV=12]{scrbook} % two-sided % original source stated: BCOR=12mm,DIV=12 \documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc,DIV=12]{scrbook} % one-sided

Best Answer

See if the following solution provide what you like to obtain:

\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{multirow}
\newcommand\mcl[1]{\multicolumn{2}{|l|}{#1}}

\begin{document}
    \begin{table}
    \footnotesize
    \sffamily
    \renewcommand\arraystretch{1.2}
      \centering
\begin{tabular}{|*{4}{l|}}
  \hline
\mcl{\textbf{learning process}}      
    &   \textbf{learning tools}            
        &   \textbf{search space}       \\
  \hline
\mcl{\multirow{2}{*}{feature engineering}}  
        & \multirow{2}{*}{(subsequent) classifiers}
            & feature sets              \\
  \cline{4-4}
\mcl{}  
        &   & feature enhancing methods and their hyper-parameters   \\
  \hline
\mcl{model selection}  
        & classifiers
            & classifiers and their hyper-parameters   \\
  \hline
\mcl{optimization algorithm selection}  
        & classifiers
            & algorithms and their hyper-parameters   \\
  \hline
\multirow{2}{12mm}{full scope}
    &   general
        & classifiers
            &   xxx \\
  \cline{2-4}
    &   neural arcitecture search (NAS)
        &   neural networks
            &   networtk structure              \\     
  \hline
\end{tabular}
    \caption{Caption}
\label{tab:table-name}
    \end{table}
\end{document}

enter image description here

Addendum: Table using tabularx table environment which enable multi lines text in cells:

enter image description here

\documentclass{article}
\usepackage{geometry}
\usepackage{multirow, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\mcl[1]{\multicolumn{2}{|l|}{#1}}

\begin{document}
    \begin{table}
\renewcommand\tabularxcolumn[1]{m{#1}}
    \sffamily
    \renewcommand\arraystretch{1.2}
    \centering
\begin{tabularx}{\linewidth}{|l
                             |l
                             |>{\hsize=0.6\hsize}L
                             |>{\hsize=1.4\hsize}L|}
  \hline
\mcl{\textbf{learning process}}      
    &   \textbf{learning tools}            
        &   \textbf{search space}       \\
  \hline
\mcl{\multirow{3}{*}{feature engineering}}  
        & \multirow{3}{=}{(subsequent) classifiers}
            & feature sets              \\
  \cline{4-4}
\mcl{}  
        &   & feature enhancing methods and their hyper-parameters   \\
  \hline
\mcl{model selection}  
        & classifiers
            & classifiers and their hyper-parameters   \\
  \hline
\mcl{optimization algorithm selection}  
        & classifiers
            & algorithms and their hyper-parameters   \\
  \hline
\multirow{2}{8mm}{full scope}
    &   general
        & classifiers
            &   xxx \\
  \cline{2-4}
    &   neural arcitecture search (NAS)
        &   neural networks
            &   networtk structure              \\     
  \hline
\end{tabularx}
    \caption{Caption}
\label{tab:table-name}
    \end{table}
\end{document}
Related Question