I need this table:
(each row and column should have the same height and length, last cell should be divided by diagonal line). I tried the following code:
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{makecell}
\newcolumntype{x}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\begin{document}
\setlength{\extrarowheight}{0.1cm}
\begin{tabular}{|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|}\hline
&&&&20\\ \hline
&&&&30\\ \hline
&&&&45\\ \hline
15&12&18&50&\diaghead(-3,2){\hskip \hsize}{$a_i$}{$b_j$}\\ \hline
\end{tabular}
\end{document}
but text in the last cell is displayed incorrectly and cells are not the same.
How can I change that?
slashbox
instead.diagbox
, which seems to me to do the job noticeably better thanslashbox
? i know it's not "sexy" any more to be usingpict2e
graphics, but it does do this job pretty well...diagbox
(for completeness)?