1

I want to add a diagonal separating line in a title box of a tabular, but the line doesn't appear (I draw it in red on the picture)

\begin{center}
  \begin{tabular}{|l|*{2}{c|}}
      \hline
      \backslashbox{Mounth}{Year}&2015&2016 \\
      \hline
      Mai&2560&3610 \\
      \hline
      June&1465&2985 \\
      \hline
  \end{tabular}
\end{center}

enter image description here

Hind Dev
  • 641

1 Answers1

3

You can use \diagbox:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{diagbox}

\begin{document}

\begin{center}
  \begin{tabular}{|l|*{2}{c|}}
      \hline
      \diagbox{Mounth}{Year} & 2015 & 2016 \\
      \hline
      Mai&2560&3610 \\
      \hline
      June&1465&2985 \\
      \hline
  \end{tabular}
\end{center}

\end{document}

which gives

enter image description here

Hope this helps!

auden
  • 1,458