Splitting a cell diagonally
If we need a header for the first column but also for the entries of the first row, the top-left cell can be split to contain both header entries, separated by a diagonal line.
How to do it...
We will use the slashbox package. It is part of MiKTeX but not part of TeX Live. Users of TeX Live can download it from CTAN at https://ctan.org/pkg/slashbox.
In this recipe, we will build a timetable. It’s intended to be filled out by hand later, so we use vertical lines for delimiting fields. Follow these steps:
- Use any document class; here, we use the article class:
\documentclass{article}
- Load the slashbox package:
\usepackage{slashbox}
- Within the document body, create the tabular layout:
\begin{document} \renewcommand{\arraystretch}{1.8} \begin{tabular}{|l|c|c|c|c|c|} \hline \backslashbox{Time}{Weekday} & Monday & Tuesday ...