Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Tables of numbers

Is it possible to put a "x\y" style legend in one cell (maybe be made up of several cells) of a table? It would be great to make the 'x' slightly lower while the 'y' slight higher.

Please see the picture below for illustration:

XY_style

Thank you very much.

share|improve this question

marked as duplicate by Caramdir, lockstep, Joseph Wright Feb 22 '11 at 8:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Welcome to tex.sx! Note that it is unusual around here to sign your questions (as there is already a box with your username below it) or to have any greeting. A suggestion: Change your username to something more telling than "user2015". –  lockstep Feb 22 '11 at 0:35
2  
Have a look at tex.stackexchange.com/questions/7262/tables-of-numbers, tex.stackexchange.com/questions/9275/… and tex.stackexchange.com/questions/9253/slashbox-alternative. Maybe one of the solutions to these questions is applicable to your case. –  Caramdir Feb 22 '11 at 1:29
    
Thanks for the suggestions, @lockstep:) –  Li Wang Feb 22 '11 at 4:44
1  
tex.stackexchange.com/questions/7262/tables-of-numbers provides a perfect solution --- i.e. \backslashbox in slashbox package. Thank you very much @Caramdir. –  Li Wang Feb 22 '11 at 4:47

1 Answer 1

up vote 5 down vote accepted

AFAIK, there are two packages for this purpose. One is my diagbox (replacement of old slashbox). The other is makecell. Here is an example of \diaghead in makecell:

\documentclass{article}
\usepackage{diagbox}
\usepackage{makecell}
\begin{document}

\section*{diagbox}

\begin{tabular}{|l|c|c|}\hline
\theadfont\diagbox[width=11em]{Diag\\Column Head I}{Diag Column\\Head II}&
\thead{Second\\column}&\thead{Third\\column}\\    \hline
& foo & bar \\    \hline
\end{tabular}

\section*{makecell}

\begin{tabular}{|l|c|c|}\hline
\diaghead{\theadfont Diag ColumnmnHead II}%
{Diag\\Column Head I}{Diag Column\\Head II}&
\thead{Second\\column}&\thead{Third\\column}\\    \hline
& foo & bar \\    \hline
\end{tabular}
\end{document}

enter image description here

share|improve this answer
    
maybe you could add the makecell answer to the duplicate question, so that we have all solutions in one place. –  Caramdir Feb 23 '11 at 0:23
    
@Caramdir: Yes. But which one should I answer? I've no good idea. –  Leo Liu Feb 23 '11 at 4:17
    
Ok, I add this answer to tex.stackexchange.com/questions/9253/slashbox-alternative –  Leo Liu Feb 23 '11 at 4:22
    
This also works:) Thank you very much!! –  Li Wang Mar 10 '11 at 7:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.