text: Q:
  
  How to remove undesired line and add the desired one in a table?
  
  I have a table as below:-
  \begin{table}
  \begin{tabular}{|l | c | c | c |}
  \hline
  & & 1 & 2 \\
  \hline
  
  \multirow{2}{*}{$abc$} & def & 
  \multicolumn{2}{c}{\multirow{2}{*}{klm}} 
  
  \\
  \cline{2-2}
  & ghi & \\
  \hline
  
  \end{tabular}
  \end{table}
  
  However, I want to remove the line below "klm" and add line at the right of "klm". How can I do that?
  Many thanks!
  
  A:
  
  on row 2 you want
  \multicolumn{2}{c|}{...}
  
  to re-insert the vertical rule. Similarly on row 3 you want an (empty) two column entry that re-inserts a rule so
  & ghi & \multicolumn{2}{c|}{}\\
  
  