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.

How can I create the following table in LaTeX? I created the table below using PowerPoint.

enter image description here

Here is my best attempt at using LaTeX to create the table:

\begin{tabular}{l|l|l|}
  \cline{2-3} 
  & \multicolumn{2}{|c|}{Returning Week} \\ \cline{2-3}
    & 1 & 2 \\ \hline
  \multicolumn{1}{|l|}{1} & 0.3 & 0.2 \\ \hline
  \multicolumn{1}{|l|}{2} & 0.1 & 0.1 \\ \hline
\end{tabular}

and the output

enter image description here

Similar tex.stackexchange posts:

share|improve this question
    
From the first linked question, all you need is the rotating package and its sideways environment. Please add your code for the table (without the rotated label, of course). –  karlkoeller Aug 22 '13 at 16:53
    
@karlkoeller Done! It does look ugly that the columns 1 and 2 have different widths. How should I fix that? –  I Like to Code Aug 22 '13 at 18:41

2 Answers 2

up vote 4 down vote accepted
\documentclass{article}
\usepackage{rotating}
\begin{document}
\raisebox{-.2in}{\rotatebox{90}{Arriving Week}}
\renewcommand\arraystretch{1.2}
\begin{tabular}[b]{p{0.8in}|p{0.8in}|p{0.8in}|}
  \cline{2-3} 
  & \multicolumn{2}{|c|}{Returning Week} \\ \cline{2-3}
    & 1 & 2 \\ \hline
  \multicolumn{1}{|l|}{1} & 0.3 & 0.2 \\ \hline
  \multicolumn{1}{|l|}{2} & 0.1 & 0.1 \\ \hline
\end{tabular}
\end{document}

enter image description here

share|improve this answer

Similar to Steven's solution, but reproduces almost exactly the table in your image.

You have to compile it with xelatex.

\documentclass{article}

\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Calibri}

\renewcommand\arraystretch{1.15}

\begin{document}

\raisebox{-1.4cm}{\rotatebox{90}{Arriving Week}}\hspace{3pt}
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
  \multicolumn{1}{l}{}  & \multicolumn{2}{l}{\hspace{1.1cm}Returning Week} \\ \cline{2-3}
  \multicolumn{1}{l|}{} & 1 & 2 \\ \hline
  1 & 0.3 & 0.2 \\ \hline
  2 & 0.1 & 0.1 \\ \hline
\end{tabular}

\end{document} 

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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