0

I had a look at a few similar questions but none seems to be identical to mine.

Here is a MWE:

\documentclass[a4paper]{article}

\usepackage{multirow}
\usepackage{multicol}

\begin{document}

\begin{tabular}{|*{5}{c|}}
\hline 
\backslashbox{1}{2} & A & B & C & D \\
\hline 
a & \multicolumn{3}{c|}{\multirow{3}{*}{P}}   & x \\
\cline{1-1} \cline{5-5}
b  & & & & y  \\
\cline{1-1} \cline{5-5}
c & & &  & z \\
\hline 
d & q & n & t & r \\
\hline 
e & l & m & s & p \\
\hline 
\end{tabular}

\end{document}

The column B is partially bounded by 2 vertical lines. I would prefer to have a big 3 by 3 cell for the entry P.

How can I do that?

Taladris
  • 115
  • 5
  • Have a look at http://mirrors.ctan.org/macros/latex/contrib/booktabs/booktabs.pdf - if you don't use any vertical lines in the first place, you will get a professional looking table and, as a side effect, avoid your problem – samcarter_is_at_topanswers.xyz Sep 06 '21 at 08:13

1 Answers1

1

Just add "phantom" multicolumns below the cell containing P:

\documentclass[a4paper]{article}

\usepackage{multirow}
\usepackage{multicol}
\begin{document}

\begin{tabular}{|*{5}{c|}}
\hline 
\backslashbox{1}{2}  & A & B & C & D \\
\hline 
a & \multicolumn{3}{c|}{\multirow{3}{*}{P}}   & x \\
\cline{1-1} \cline{5-5}
%% Add a \multicolumn here
b  & \multicolumn{3}{c|}{}   & x \\
\cline{1-1} \cline{5-5}
%% Add a \multicolumn here
c & \multicolumn{3}{c|}{}& z \\
\hline 
d & q & n & t & r \\
\hline 
e & l & m & s & p \\
\hline 
\end{tabular}

\end{document}
Eddymage
  • 1,008
  • 1
  • 7
  • 22