Graphics, Figures & TablesDiagonal Line in Tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gdg
Posts: 1
Joined: Sun Aug 21, 2011 5:31 pm

Diagonal Line in Tables

Post by gdg »

Hi to all. I am a new user of Latex and I hope that some of you can help me. I'm turning mad! ahah

I'm trying to create in Latex the table attached.
Here's my attempt which, unfortunately, does not seem to work.
Any ideas/tips?
thanks for your attention and I hope you can help me!!
G

Code: Select all

\begin{tabular}{cc|ccc|ccc|ccc|ccc|}
\cline{3-14}
 & & \multicolumn{3}{|c|}{{\bf Denmark}} &\multicolumn{3}{|c|}{{\bf France}} & \multicolumn{3}{|c|}{{\bf Italy}} &  \multicolumn{3}{|c|}{{\bf England}} \\ \cline{3-14}
\multicolumn{2}{|c|}{\backslashbox{Wave 1 \kern-2em}{\kern-1em Wave 2}} & \rotatebox{90}{\begin{minipage}{2.1cm} \bf Not \\ Depressed \end{minipage}} & {\begin{sideways}\bf Depressed \end{sideways}} &  {\begin{sideways}\bf N \end{sideways}} &   \rotatebox{90}{\begin{minipage}{2cm} Not \\ Depressed \end{minipage}} & {\begin{sideways}\bf Depressed \end{sideways}} &  {\begin{sideways}\bf N \end{sideways}} & \rotatebox{90}{\begin{minipage}{2cm} Not \\ Depressed \end{minipage}} & {\begin{sideways}\bf Depressed \end{sideways}} &  {\begin{sideways}\bf N \end{sideways}} & \rotatebox{90}{\begin{minipage}{2cm} Not \\ Depressed \end{minipage}} & {\begin{sideways}\bf Depressed \end{sideways}} &  {\begin{sideways}\bf N \end{sideways}} \\
\hline
\multicolumn{1}{c|}{\multirow{4}{*}{\begin{sideways}\bf MEN \end{sideways}}} & \multicolumn{1}{|c|}{\bf Not} &  89.3 &  10.7 & \multirow{2}{*}{356} & 91.3 & 8.7 & \multirow{2}{*}{419} & 88.9 &  11.1 & \multirow{2}{*}{417} &  89.4 &  10.4 & \multirow{2}{*}{2,292} \\
 & \multicolumn{1}{|c|}{\small \bf Depressed} &(318) &(38) & &(382) &(37) & &(366) &(51) & &(2,057) &(235) & \\ \cline{2-14}
\multicolumn{1}{c|}{} & \multirow{2}{*}{\small \bf Depressed} &68.7 &31.3 &\multirow{2}{*}{52} &63.5 &36.5 &\multirow{2}{*}{114} &46.4 &       53.6 & \multirow{2}{*}{111} & 48.2 & 51.8 & \multirow{2}{*}{500} \\
 & \multicolumn{1}{|c|}{} & (36) &(16) &  & (71) &(43) & & (50) &(61) &  & (246) & (254) & \\ 
\hline
\multicolumn{14}{c}{} \\ 
\hline
\end{tabular}
Attachments
latex.JPG
latex.JPG (35.19 KiB) Viewed 9896 times
Last edited by localghost on Sun Aug 21, 2011 6:33 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Diagonal Line in Tables

Post by cgnieder »

That's (for example) possible using the slashbox package (not in TeXlive)

Code: Select all

\documentclass{article}
\usepackage{slashbox}

\begin{document}

\begin{tabular}{|c|c|c|} \hline 
\backslashbox{below}{above} & b & c \\ \hline
d & 1 & 2 \\ \hline
e & 3 & 4 \\ \hline
\end{tabular}

\end{document}
site moderator & package author
Post Reply