I am trying to split the "Score\exp" cell diagonally where I can write "score" in one half and "exp" in the other half, any ideas?
My code:
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{rrrrrrrr}
\toprule
Score\textbackslash{}exp & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\
\midrule
1 & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\
2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\
3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 \\
4 & 4 & 4 & 4 & 4 & 4 & 4 & 4 \\
5 & 5 & 5 & 5 & 5 & 5 & 5 & 5 \\
6 & 6 & 6 & 6 & 6 & 6 & 6 & 6 \\
7 & 7 & 7 & 7 & 7 & 7 & 7 & 7 \\
8 & 8 & 8 & 8 & 8 & 8 & 8 & 8 \\
9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 \\
10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 \\
11 & 11 & 11 & 11 & 11 & 11 & 11 & 11 \\
12 & 12 & 12 & 12 & 12 & 12 & 12 & 12 \\
13 & 13 & 13 & 13 & 13 & 13 & 13 & 13 \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
Best Answer
With package
makecell
you can obtain the following table:Code of above table is:
Edit: For diagonal line in the far left top cell is used macro
\diaghead
from packagemakecell
. About it is in package documentation on page 16 stated:As you can see from code, for length of cell I select width of compounded word
Scoreexp
. Instead it you can split them into tow words or define ratio (in my MWE it is omitted) between height and width of cell. Select this option according to your taste.