# Slashbox with tables: Adjusting the diagonal separator for multiple rows

I am using the slashbox package in a table as shown next. However as you can see, the diagonal line in the first cell is not the real diagonal of that cell. This is because of the existence of more than a row in that cell. So how to make the diagonal line reach from the top left corner to the bottom right corner of the first cell to the left?

Here is my code:

\documentclass[12pt]{article}
\usepackage{slashbox}

\begin{document}

\begin{table}[htbp]
\begin{center}
\begin{tabular}[htp]{||l|c|c|c|c||}
\hline
& can definitely & \multicolumn{2}{c|}{can definitely } & can definitely\\
person
& walk & \multicolumn{2}{c|}{jump} & run\\
\cline {3-4}
& & more than
& more than & \\
& & 10 cm
& 20 cm & \\[4mm]
\hline \hline
Joe & Yes & No & No & No \\[4mm]
\hline
\end{tabular}
\end{center}
\end{table}

\end{document}

Thank you.

To get a cell spanning several rows, you can use the multirow package. \backslashbox works well with this within its implemantion limits - the slash is constructed as a LaTeX picture, and so there are only a limited number of slopes for the line allowed.

\documentclass[12pt]{article}

\usepackage{slashbox,multirow}

\begin{document}

\begin{table}[htbp]
\begin{center}
\begin{tabular}[htp]{||l|c|c|c|c||}
\hline
& can definitely & \multicolumn{2}{c|}{can definitely } & can definitely\\
& walk & \multicolumn{2}{c|}{jump} & run\\
\cline {3-4} & & more than & more than & \\
& & 10 cm & 20 cm &\\
\hline \hline
Joe & Yes & No & No & No \\
Margaret & Yes & Yes & Yes & Yes \\
\hline
\end{tabular}
\end{center}
\end{table}

\end{document}

A more sophisticated solution with, more flexible choices of slash line, would use something like tikz, see Diagonal lines in table cell for some such approaches, but would still require such a \multirow command.

• @ Andrew Swann Thank you very much. It works fine. I need a \backslashbox[50mm]{...} for example if I have longer words in the first cell. 1 vote up. – yCalleecharan May 14 '13 at 7:54