# Split a cell diagonally in a table to write proper titles

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
\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}%
\end{table}%


edit: The table is now shown as:

With package makecell you can obtain the following table:

Code of above table is:

\documentclass{article} %
\usepackage{booktabs,makecell}
\usepackage[margin=10pt,
font=normalsize,
labelfont=bf,
labelsep=space,
position=below]{caption} % 08_03_2014

\begin{document}
\begin{table}[htbp]
\centering
\label{tab:mytable}
\begin{tabular}{c*{7}{r}}
\specialrule{1pt}{0pt}{0pt}
& 1     & 2     & 3     & 4     & 5     & 6     & 7 \\
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}%
\end{table}
\end{document}


Edit: For diagonal line in the far left top cell is used macro \diaghead from package makecell. About it is in package documentation on page 16 stated:

This package offers macro based on possibilities of picture environment.

\diaghead(<H ratio,V ratio>){hText set for column widthi}%

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.
• @SMH, now I see, that in my MWE the last line of MWE €nd{document} is missed. I correct this now. Please test this code. If you still have a problems, please send error message which you receive. – Zarko Sep 16 '15 at 12:58