[Tex/LaTex] Table rotation with sidewaystable

rotatingtables

I rotated a table using sidewaystable but the first and last 4 cells of the first row appear with a wrong vertical alignment. Can anyone solve this problem?
enter image description here

\documentclass[twoside,b5paper,12pt,fleqn]{psd_thesis}
\usepackage{amsmath,amssymb,amsfonts}           \usepackage[T1]{fontenc}
\usepackage{newtxmath,newtxtext}                
\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{tabulary}                                                           
% Include the following packages 
\usepackage{amsmath}
\usepackage{array}
\usepackage{booktabs}  % for \toprule, \midrule, and \bottomrule macros 

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

%\begin{footnotesize}
\begin{sidewaystable}
\scriptsize
\centering
\begin{tabular}{ C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm}      C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} }    
%\begin{tabular}{c c c c c c c c c c c c c c}
\toprule
Sv,ieq  &   000436xa    &   000594xa    &   001715xa    &   001932ya    &     006040ya  &   006263xa    &   007162ya    &   007257ya    &   IT0605ya    &     IT0790xa  &   emiliaeo-retro  &   emilians-retro  \\   \midrule
0.4 &   2.447   &   2.177   &   2.304   &   4.921   &   4.298   &   2.121   &   3.928   &   3.478   &   3.462   &   1.751   &   0.875   &   0.525   \\    \hline
0.8 &   4.894   &   4.354   &   4.609   &   9.843   &   8.597   &   4.241   &   7.857   &   6.957   &   6.924   &   3.502   &   1.750   &   1.049   \\   \hline
1.2 &   7.341   &   6.530   &   6.913   &   14.764  &   12.895  &   6.362   &   11.785  &   10.435  &   10.386  &   5.252   &   2.625   &   1.574   \\   \hline
1.6 &   9.789   &   8.707   &   9.218   &   19.686  &   17.194  &   8.482   &   15.713  &   13.914  &   13.848  &   7.003   &   3.500   &   2.099   \\   \hline
2   &   12.236  &   10.884  &   11.522  &   24.607  &   21.492  &   10.603  &   19.642  &   17.392  &   17.310  &   8.754   &   4.375   &   2.624   \\   \hline
2.4 &   14.683  &   13.061  &   13.827  &   29.529  &   25.791  &   12.723  &   23.570  &   20.871  &   20.772  &   10.505  &   5.250   &   3.148   \\   \hline
2.8 &   17.130  &   15.237  &   16.131  &   34.450  &   30.089  &   14.844  &   27.498  &   24.349  &   24.234  &   12.256  &   6.125   &   3.673   \\   \hline
3.2 &   19.577  &   17.414  &   18.435  &   39.372  &   34.388  &   16.965  &   31.427  &   27.828  &   27.697  &   14.006  &   7.000   &   4.198   \\   \hline
3.6 &   22.024  &   19.591  &   20.740  &   44.293  &   38.686  &   19.085  &   35.355  &   31.306  &   31.159  &   15.757  &   7.875   &   4.723   \\   \hline
4   &   24.471  &   21.768  &   23.044  &   49.215  &   42.984  &   21.206  &   39.283  &   34.784  &   34.621  &   17.508  &   8.750   &   5.247   \\   \hline
4.4 &   26.919  &   23.945  &   25.349  &   54.136  &   47.283  &   23.326  &   43.212  &   38.263  &   38.083  &   19.259  &   9.625   &   5.772   \\   \hline
4.8 &   29.366  &   26.121  &   27.653  &   59.058  &   51.581  &   25.447  &   47.140  &   41.741  &   41.545  &   21.009  &   10.500  &   6.297   \\   \hline
5.2 &   31.813  &   28.298  &   29.957  &   63.979  &   55.880  &   27.567  &   51.068  &   45.220  &   45.007  &   22.760  &   11.375  &   6.821   \\   \hline
5.6 &   34.260  &   30.475  &   32.262  &   68.900  &   60.178  &   29.688  &   54.996  &   48.698  &   48.469  &   24.511  &   12.250  &   7.346   \\   \hline
6   &   36.707  &   32.652  &   34.566  &   73.822  &   64.477  &   31.809  &   58.925  &   52.177  &   51.931  &   26.262  &   13.125  &   7.871   \\       \bottomrule 
\end{tabular}
\caption{Caption}
\end{sidewaystable}
%\end{footnotesize}

\end{document}

The psd_thesis.cls is reported below:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{psd_thesis}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}

\ProcessOptions

\LoadClass{report}

\renewcommand{\baselinestretch}{1.5}  % Double-spaced

\usepackage[round]{natbib}  % bib style

%\usepackage[tx]{sfmath}      % a package of fonts
%\usepackage{helvet}             % For Helvetica (Arial is just a bad copy of Helvetica)
%\renewcommand\familydefault{\sfdefault}  

\renewcommand{\@makechapterhead}[1]{%
\vspace*{50\p@}%  {\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
    \large \scshape \bfseries \@chapapp\space \thechapter
    \par\nobreak
    \vskip 20\p@
\fi
\interlinepenalty\@M
\large \bfseries #1\par\nobreak
\vskip 40\p@  }}

\renewcommand{\@makeschapterhead}[1]{%
\vspace*{50\p@}%{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\large \scshape \bfseries  #1\par\nobreak
\vskip 40\p@  }}  

\renewcommand{\section}{\@startsection{section}% % the name{1}% % the level{0mm}% % the indent{3.0\baselineskip}% % the before skip{2.5\baselineskip}% % the after skip{\normalfont \normalsize}} % the style

\renewcommand{\subsection}{\@startsection{subsection}% % the name
{2}% % the level{0mm}% % the indent{-\baselineskip}% % the before skip{1.5\baselineskip}% % the after skip{\normalfont \normalsize}} % the style

\endinput

Best Answer

I made test with document class book, since your problem is tied with definition of \newcolumtype. Instead yours try to use:

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}

and align of texts in the first row will become:

enter image description here

In test I use for page layout package geometry with option b5paper and showframe. The latter option is only for seeing page layout. With this option your table is to wide, so I alo add \setlength\tabcolsep{3pt}. So my preamble and few rows of table was:

    \documentclass[twoside,12pt,fleqn]{book}
        \usepackage[b5paper,showframe]{geometry}
    \usepackage[T1]{fontenc}
    %\usepackage{amsmath,amssymb,amsfonts}
    %\usepackage{newtxmath,newtxtext}
    %\usepackage{textgreek}
    \usepackage{rotating}
    %\usepackage{pdflscape}
    %\usepackage{tabulary}
    % Include the following packages
    %\usepackage{amsmath} % second time ...
    \usepackage{array}
    \usepackage{booktabs}  % for \toprule, \midrule, and \bottomrule macros
    \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}

    \begin{document}
        \begin{sidewaystable}
    \scriptsize
    \setlength\tabcolsep{3pt}
        \begin{tabular}{ C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm}      C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} C{1.1cm} }
    %\begin{tabular}{c c c c c c c c c c c c c c}
    \toprule
    Sv,ieq  &   000436xa    &   000594xa    &   001715xa    &   001932ya    &     006040ya  &   006263xa    &   007162ya    &   007257ya    &   IT0605ya    &     IT0790xa  &   emiliaeo-retro  &   emilians-retro  \\   \midrule

    \end{tabular}
\caption{Caption}
    \end{sidewaystable}
\end{document}

Addendum: First off-topic. To my taste the table will look better if you

  • use S column type from siunitx package
  • omit all \hline in table

In this case code becomes:

\documentclass[twoside,12pt,fleqn]{book}
    \usepackage[b5paper,showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage{rotating}
\usepackage{booktabs}  % for \toprule, \midrule, and \bottomrule macros
\usepackage{siunitx}  % for better formatting columns with decimal numbers

\begin{document}
    \begin{sidewaystable}
\scriptsize
\setlength\tabcolsep{3pt}
    \begin{tabular}{@{}S[table-format=1.1]*{12}{S[table-format=2.3]}@{}}
\toprule
\multicolumn{11}{c}{}   &   \multicolumn{2}{c}{retro}   \\
    \cmidrule{12-13}
{Sv,ieq} & {000436xa} & {000594xa} & {001715xa} & {001932ya}    & {006040ya}  & {006263xa}    & {007162ya} & {007257ya} & {IT0605ya} & {IT0790xa}  & {emiliaeo} &  {emilians} \\   \midrule
0.4 &   2.447   &   2.177   &   2.304   &   4.921   &   4.298   &   2.121   &   3.928   &   3.478   &   3.462   &   1.751   &   0.875   &   0.525   \\    
0.8 &   4.894   &   4.354   &   4.609   &   9.843   &   8.597   &   4.241   &   7.857   &   6.957   &   6.924   &   3.502   &   1.750   &   1.049   \\   
1.2 &   7.341   &   6.530   &   6.913   &   14.764  &   12.895  &   6.362   &   11.785  &   10.435  &   10.386  &   5.252   &   2.625   &   1.574   \\  
...
    \bottomrule
    \end{tabular}
\caption{Caption}
    \end{sidewaystable}
\end{document}

and gives:

enter image description here

Regarding additional question in your comment:

  1. Table in my test is centeret on page
  2. don't do it this. Table already ocupay whole text height and any further reducing font in table will make it not readable. Also is natural that caption is below or above table