in Microsoft word I have a table which has the following structure.
Now, I need to make a similar table in LaTex to submit a publication, I tried with the following code,
%%***************************************************************
\documentclass[twoside,12pt]{article}% *
\usepackage{graphicx}% *
\begin{document}
%===============Table Starts====================================
Table 1. This is a table
\begin{center}%[htbp]
\begin{tabular}{l rrrrrrrr}\hline
\rotatebox{90}{Number of
Married Years} & \rotatebox{90}{Observed Frequency (Year 1)} & \rotatebox{90}{Expected Poisson Frequency (Year 1)} &
\rotatebox{90}{Expected Binomal Frequency (Year 1)} & \rotatebox{90}{Expected Normal Frequency (Year 1)} & \rotatebox{90}{Observed Frequency (Year 2)} & \rotatebox{90}{Expected Poisson Frequency (Year 2)} & \rotatebox{90}{ Expected Binomial
Frequency (Year 2) } & \rotatebox{90}{Expected Normal Frequency (Year 2)}\\\hline
0 & x & y & z & a & b & c & d & e \\
1 & x & y & z & a & b & c & d & e \\
2 & x & y & z & a & b & c & d & e \\
3 & x & y & z & a & b & c & d & e \\\hline
\end{tabular}
\label{tab1}
\end{center}
\end{document}
This code produces a table like the below,
It would be a great help if you could guide me in wrapping the rotated text in the first row of the table.
Best Answer
\parbox
is an obvious choice here. I've wrapped this in a command\spheading[<width>]{<stuff>}
(default of width is10em
), to avoid duplication of angles:Without more information, I've kept the column alignment as-is. However, a centred display would look better here.