How can I draw a diagonal that on one side, says Ratings and on the other, books?
This is an example made by @Marmot:
\documentclass{article}
\usepackage{amsmath,blkarray}
\begin{document}
\[
\begin{blockarray}{lccc}
\text{Ratings} & \text{book}_1 & \text{book}_2 & \text{book}_3 \\
\begin{block}{l(ccc)}
\text{user}_1 & - & 1 & - \smash[b]{\vphantom{\Big|}}\\
\text{user}_2 & - & 5 & - \\
\text{user}_3 & 4 & - & - \\
\text{user}_4 & - & - & 2\smash[t]{\vphantom{\Big|}}\\
\end{block}
\end{blockarray}
\]
\end{document}
Desired output:



tikz-pgf(which you chose as a tag for your question)? Lastly, you might be interested in Diagonally divided table cell or Diagonal lines in table cell – leandriis Jul 06 '19 at 09:47