3

I have a table:

\begin{center}
\begin{tabular}{| c || c | c | c | c | c |}
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline\hline
        & $X=3$ & $X=5$ & $X=7$ & $X=9$ & $X=11$ \\
\hline
\end{tabular}
\end{center}

and I want to clear the empty box lines in the bottom-left. How do it achieve this look?

1
  • 2
    Welcome on TeX StackExchange. You should provide a complete compilable file, with the \documentclass, the \begin{document}, etc. Apr 11 at 17:59

2 Answers 2

3

With {NiceTabular} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\begin{center}
\renewcommand{\arraystretch}{1.4}
\begin{NiceTabular}{c||ccccc}[corners,hvlines]
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\Hline\Hline
        & $X=3$ & $X=5$ & $X=7$ & $X=9$ & $X=11$ \\
\end{NiceTabular}
\end{center}

\end{document}

You need several compilations.

Output of the above code

2

A solution that preserves the use of a tabular environment.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{array}
\begin{document}

\begin{center}
\begin{tabular}{ |c|| *{5}{c|} }
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline
$Y=11$  & 0.2   & 0.0   & 0.1   & 0.0   & 0.1    \\
\hline\hline
\multicolumn{1}{c||}{} & $X=3$ & $X=5$ & $X=7$ & $X=9$ & $X=11$ \\
\cline{2-6}
\end{tabular}
\end{center}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .