multirow, multicolumn in tables and lining

The usual table commands are used to produce a table of rectangular shape that is uniform in the sense, that any two rows or any two columns contain same number of blocks.

However, to merge multiple rows or columns, the commands \multirow and \multicolumn are used.

But I was facing problem when creating following kind of table using \multirow or \multicolumn.

The problem was that the horizontal line command \hline was producing the line which was coming over all the columns, whereas, in the following table, the horizontal lines which are coming over first column are just top and bottom.

How can we make such table with some modification in use of \multirow and \multicolumn?

Edit:

\begin{center}
\begin{tabular}{|l|l|l|l|l|}
\hline
\multirow{1}{*}{No.}&\multicolumn{4}{l|}{Education}\\
\hline
0 & 2 & 3 & 4 & 5 \\
& 6 & 7 & 8 & 9 \\\hline
\end{tabular}
\end{center}

• Use \cline{1-2} instead of \hline (in the rows without horizontal lines in the last columns). Aug 23, 2018 at 8:41
• Could you post a (full) code of what you've done so far? Aug 23, 2018 at 8:44
• I tried this, to merge many rows/columns as an example. But here \hline was giving complete horizontal line (i.e. crossing all columns). I wanted it only from second column to last one). Aug 23, 2018 at 9:00

% \usepackage{multirow}
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|}
\hline
\multirow{7}{*}{4.} & \multicolumn{4}{l|}{Education Qualification}                                 \\ \cline{2-5}
& Degree             & DD-MM-Year & University / Institute & Specialization    \\ \cline{2-5}
& Ph.D. Start Date   &            & \multirow{3}{*}{}      & \multirow{3}{*}{} \\ \cline{2-3}
& Date of Submission &            &                        &                   \\ \cline{2-3}
& Date of Defence    &            &                        &                   \\ \cline{2-5}
& Masters:           &            &                        &                   \\ \cline{2-5}
& Bachelors          &            &                        &                   \\ \hline
\multicolumn{5}{|l|}{(Add more rows if needed)}                                                    \\ \hline
\end{tabular}
\end{table}

• For academic honesty I have to add that I used the online service www.tablesgenerator.com to provide this solution <:-) Aug 23, 2018 at 18:15

You can create that table very easily with {NiceTabular} of nicematrix.

In that environment, which is similar to the classical {tabular} (of array) you merge cells both horizontally and vertically with the command \Block. Then, the key hvlines draws all the rules, excepted in the blocks (created by \Block).

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\begin{table}[]
\begin{NiceTabular}{lllll}[hvlines]
\Block{8-1}{4.} & \Block[l]{1-*}{Education Qualification} \\
& Degree             & DD-MM-Year & University / Institute & Specialization \\
& Ph.D. Start Date   &            & \Block{3-1}{}          & \Block{3-1}{}  \\
& Date of Submission \\
& Date of Defence    \\
& Masters:           \\
& Bachelors          \\
\\
\Block[l]{1-*}{(Add more rows if needed)} \\
\end{NiceTabular}
\end{table}

\end{document}