# slashbox alternative [duplicate]

Possible Duplicate:
Diagonal lines in table cell

Is there a better way to label both axes of a table at the same time rather than using slashbox? It looks kind of ugly.

## Edit

I wrote a new diagbox package as a replacement of old slashbox. It is more modern that draw the diagonal lines via pict2e package, and easier to use:

\documentclass{article}

\usepackage{diagbox}

\begin{document}

\begin{tabular}{|l|c|c|}\hline
Second & Third \\ \hline
& foo & bar \\ \hline
\end{tabular}

\end{document}


Additional information can be found in the document.

AFAIK, there are two packages for this diag cell in table. One is slashbox, the other is makecell, which may produce better result sometimes. Here is an example of \diaghead in makecell:

\documentclass{article}
\usepackage{makecell}
\begin{document}
\begin{tabular}{|l|c|c|}\hline
& foo & bar \\    \hline
\end{tabular}
\end{document}


And it would be even better on screen if you use pict2e package together with slashbox or makecell.

You are right that they do not look very nice. You can use two different alternatives. In first one you can use a sub-heading, as the first example in the code below and the second one (which I prefer) is to assume that your reader is an intelligent human being and omit them altogether! By proper captioning you can also ensure that your message is clear.

\documentclass{article}
\usepackage{slashbox,booktabs,amsmath}
\pagestyle{empty}
\begin{document}

\noindent
\begin{tabular}{|l||*{5}{c|}}\hline
\backslashbox{Room}{Date}
&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline
Meeting Room &&&&&\\\hline
Auditorium &&&&&\\\hline
Seminar Room &&&&&\\\hline
\end{tabular}

\bigskip

\begin{table}[htbp]
\begin{tabular}{llllll}
\toprule
\textbf{Date} &\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\
\midrule
\textbf{Room} &&&&&\\
Meeting Room &&&&&\\
Auditorium &&&&&\\
Seminar Room &&&&&\\
\bottomrule
\end{tabular}
\caption{Room availability \textit{vs} dates.}
\end{table}

\bigskip

\begin{table}[htbp]
\begin{tabular}{llllll}
\toprule
~&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\
\midrule
Meeting Room &&&&&\\
Auditorium &&&&&\\
Seminar Room &&&&&\\
\bottomrule
\end{tabular}
\caption{Room availability \textit{vs} dates.}
\end{table}

\end{document}


that is a problem when the entries for \backslashbox are very small. Insert some spaces and everything will be fine and, by the way, always load pict2e which extends the default line segments.

\documentclass{article}
\usepackage{slashbox,pict2e}
\pagestyle{empty}
\begin{document}

\noindent
\begin{tabular}{|r||*{5}{c|}}\hline
\backslashbox{Room~}{Date~~}
& 5/31& 6/1 & 6/2 & 6/3 & 6/4 \\\hline
Meeting Room &&&&& \\\hline
Auditorium   &&&&& \\\hline
Seminar Room &&&&& \\\hline
\end{tabular}

\end{document}