Build table with different cells sizes

This is not really an answer to your question, merely a suggestion and an answer:

Notes

  • \bf is a bad idea.
  • You can use \cline{2-3} to only draw a horizontal line from column 2 to 3.
  • The center environment adds vertical space (it's a list). If you don't want this use \centering (like I did in my examples).

What I would suggest

This takes advantages from the excellent booktabs package.
There are the following rules when it comes to this package (and others claim this a valid for good style, too):

  1. Don't use vertical lines.
  2. Obey rule 1.

Code

\documentclass{article}
\usepackage{booktabs}
\renewcommand{\cmidrulekern}{.25em}
\begin{document}
\begin{table}[t]%\footnotesize%\renewcommand{\arraystretch}{1.2}\addtolength{\tabcolsep}{-1pt}
\centering
\begin{tabular}{ccccc}
    \toprule
    \bfseries Types & \multicolumn{2}{c}{\bfseries Line A} & \multicolumn{2}{c}{\bfseries Line B} \\
    \cmidrule(r){2-3}\cmidrule(l){4-5}
                    & a &                b                 & a  &                b                \\
    \midrule
           x        & d &                2                 & 76 &                2                \\
           y        & 1 &                3                 & 74 &                3                \\
    \cmidrule(r){2-3}\cmidrule(l){4-5} % Maybe don't use these cmidrules.
           z        &        \multicolumn{2}{c}{4a}        &        \multicolumn{2}{c}{4a}        \\
    \bottomrule
\end{tabular}
\caption{second way}
\label{table:senspec}
\end{table}
\end{document}

Output

enter image description here

Kind of what you wanted

The vertical lines between "Types" and "Line A" as well as between "Line A" and "Line B" seem to need a little tweaking.
I'm sure someone with more (plain)TeX table experience can help us out here.

Code

\documentclass{article}
\begin{document}
\begin{table}[t]\footnotesize%\renewcommand{\arraystretch}{1.2}\addtolength{\tabcolsep}{-1pt}
\centering
\begin{tabular}{|c|@{\extracolsep{2pt}}c@{\extracolsep{-2pt}}|c|@{\extracolsep{2pt}}c@{\extracolsep{-2pt}}|c|}
\hline
    \multicolumn{1}{|c|}{\bfseries Types} & \multicolumn{2}{c}{\bfseries Line A} & \multicolumn{2}{|c|}{\bfseries Line B} \\
\hline\noalign{\smallskip}
\cline{2-3}\cline{4-5}
            \multicolumn{1}{c}{}          & \multicolumn{1}{|c|}{a} &                b                 & \multicolumn{1}{|c|}{a}  &                 b                 \\
\cline{1-1}\cline{2-3}\cline{4-5}
                      x                   & \multicolumn{1}{|c|}{d} &                2                 & \multicolumn{1}{|c|}{76} &                 2                 \\
\cline{1-1}\cline{2-3}\cline{4-5}
                      y                   & \multicolumn{1}{|c|}{1} &                3                 & \multicolumn{1}{|c|}{74} &                 3                 \\
\cline{1-1}\cline{2-3}\cline{4-5}
\noalign{\smallskip}
\hline
                      z                   &        \multicolumn{2}{c}{4a}        & \multicolumn{2}{|c|}{4a}               \\
\hline
\end{tabular}
\caption{Prediction Accuracy of the Enose System in Lung Cancer Detection}
\label{table:senspec2}
\end{table}
\end{document}

Output

enter image description here


enter image description here

hhline can help here (unrelated but never use \bf in LaTeX they are not defined at all in the format and only included in the standard classes for compatibility with LaTeX 2.09)

\documentclass{article}
\usepackage{array,hhline}

\begin{document}

\begin{table}[t]\footnotesize\renewcommand{\arraystretch}{1.2}\addtolength{\tabcolsep}{-1pt}
\begin{center}
\begin{tabular}{| c || c | c || c | c |}
\hline
\multicolumn{1}{|c|}{\textbf{Types}} & \multicolumn{2}{c|}{\textbf{Line A}} & \multicolumn{2}{c|}{\textbf{Line B}} \\
\hline
\noalign{\vskip\doublerulesep}%
\hhline{~--||--}
\multicolumn{1}{c|}{} & a  & b & a  & b \\
\hhline{-||-|-||-|-|}
x & d  & 2 & 76  & 2 \\
\hhline{-||-|-||-|-|}
y & 1 & 3 & 74 & 3 \\
\hhline{:=:b:=:=:b:=:=:}
\multicolumn{1}{|c|}{z} & \multicolumn{2}{c|}{4a} &\multicolumn{2}{c|}{4a} \\
\hline  
\end{tabular}
\caption{ll}
\label{table:senspec}
\end{center}
\end{table}

\end{document}

I was able to get to the following. It still needs improvement as the borders for first and last row do not align properly with the borders of other rows. Also width of two columns under Line A do not match.

enter image description here

\documentclass{article}

\begin{document}

\begin{table}[t]
\centering
\begin{tabular}{| c |@{}c@{\,}| c | c |@{}c@{\,}| c | c |}
    \hline
        \textbf{Types} & \multicolumn{3}{|c|}{\textbf{Line A}} & \multicolumn{3}{c|}{\textbf{Line B}} \\
    \hline 
    \multicolumn{1}{c}{} \\[-0.9\normalbaselineskip]
    \cline{3-4} \cline{6-7}
        \multicolumn{1}{c}{} & & a  & b & & a  & b \\
    \cline{1-1} \cline{3-4} \cline{6-7}
        x & & d  & 2 & &  76  & 2 \\
    \cline{1-1} \cline{3-4} \cline{6-7}
        y & & 1 & 3 & & 74 & 3 \\
    \cline{1-1} \cline{3-4} \cline{6-7}
    \multicolumn{1}{c}{} \\[-0.9\normalbaselineskip]
    \hline
        z & \multicolumn{3}{|c|}{4a} & \multicolumn{3}{c|}{4a} \\
    \hline  
\end{tabular}

\caption{ll}
\label{table:senspec}   
\end{table}

\end{document}