0

Text should be vertically aligned

This picture is a part of a table i am using, the terms subcases are vertically written but i cant center them vertically also in the next columns terms like A, B, etc are also not vertically centered. I made this table using tabulary package a. My code is

\begin{table}[H]

\centering

\caption{Saturation Table}

\label{tab:5}%

\begin{tabulary}{1\linewidth}{J J J J J J J J J J J J J}

\toprule

& \textbf{Method} & \multicolumn{1}{c}{\textbf{Parameters}} & \textbf{Step 0} & \textbf{Step 1} & \textbf{Step 2} & \textbf{Step 3} & \textbf{Step 4} & \textbf{Step 5} & \textbf{Step 6} & \textbf{Step 7} & \textbf{Step 8} & \textbf{Step 9} \\

\midrule

\multirow{4}[4]{*}{\begin{sideways}\textbf{Subcase A}\end{sideways}} & 
\multirow{2}[2]{*}{\textbf{A}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & \textbf{6} & & & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 1 & 2 & 3 & 4 & 4 & \textbf{5} & & & & \\

\cmidrule{2-13} & \multirow{2}[2]{*}{\textbf{B}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \textbf{8} & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 6 & 6 & 7 & 8 & 9 & 9 & 19 & \textbf{8} & & \\

\bottomrule

\end{tabulary}%

\end{table}%
  • Hi @Shaggi3, I think that if you provide the packages needed to runn your code we can help you much easier – koleygr Jun 19 '17 at 15:48
  • @koleygr These are all the packages im using in the document of the table \usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs} \usepackage{tabulary} \usepackage{rotating} \usepackage{float} \usepackage{multicol} \usepackage[export]{adjustbox} \usepackage[shortlabels]{enumitem} \usepackage{cite} \usepackage{array} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, \usepackage{graphicx} – Shaggi3 Jun 19 '17 at 15:55
1

Try this:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs} \usepackage{tabulary} \usepackage{rotating} \usepackage{float} \usepackage{multicol} \usepackage[export]{adjustbox} \usepackage[shortlabels]{enumitem} \usepackage{cite} \usepackage{array} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, }

\title{TestLE}
\author{Konstantinos Leledakis}
\date{June 2017}

\begin{document}

\maketitle

\section{Introduction}
\begin{table}[H]

\centering

\caption{Saturation Table}

\label{tab:5}%
\resizebox{\textwidth}{!}{
\begin{tabulary}{1.5\linewidth}{J J J J J J J J J J J J J}

\toprule

& \textbf{Method} & \multicolumn{1}{c}{\textbf{Parameters}} & \textbf{Step 0} & \textbf{Step 1} & \textbf{Step 2} & \textbf{Step 3} & \textbf{Step 4} & \textbf{Step 5} & \textbf{Step 6} & \textbf{Step 7} & \textbf{Step 8} & \textbf{Step 9} \\

\midrule

\multirow{6}[6]{*}{\rotatebox{90}{\textbf{Subcase A}}} & 
\multirow{3}[3]{*}{\textbf{A}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & \textbf{6} & & & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 1 & 2 & 3 & 4 & 4 & \textbf{5} & & & & \\

\cmidrule{2-13} & \multirow{3}[3]{*}{\textbf{B}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \textbf{8} & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 6 & 6 & 7 & 8 & 9 & 9 & 19 & \textbf{8} & & \\

\bottomrule

\end{tabulary}%
}
\end{table}%

\end{document}

This is the result:

enter image description here

It seems that the extra rows count as rows in this table and you can not ignore them in multirow count

Another answer is this:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs} \usepackage{tabulary} \usepackage{rotating} \usepackage{float} \usepackage{multicol} \usepackage[export]{adjustbox} \usepackage[shortlabels]{enumitem} \usepackage{cite} \usepackage{array} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, }


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


\date{June 2017}

\begin{document}


\section{Introduction}
\begin{table}[H]

\centering

\caption{Saturation Table}

\label{tab:5}%
\resizebox{\textwidth}{!}{
\begin{tabulary}{1.5\linewidth}{J c C{4.7cm} *{10}{C{1.5cm}}}

\toprule

& \textbf{Method} & \multicolumn{1}{c}{\textbf{Parameters}} & \textbf{Step 0} & \textbf{Step 1} & \textbf{Step 2} & \textbf{Step 3} & \textbf{Step 4} & \textbf{Step 5} & \textbf{Step 6} & \textbf{Step 7} & \textbf{Step 8} & \textbf{Step 9} \\

\midrule

\multirow{4}[4]{*}{\rotatebox{90}{\textbf{Subcase A}}} & 
\multirow{2}[2]{*}{\textbf{A}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & \textbf{6} & & & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 1 & 2 & 3 & 4 & 4 & \textbf{5} & & & & \\

\cmidrule{2-13} & \multirow{2}[2]{*}{\textbf{B}} & \textbf{No} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \textbf{8} & & \\[1mm]

& & \textbf{Maximum Saturation {(\%)}} & 6 & 6 & 7 & 8 & 9 & 9 & 19 & \textbf{8} & & \\

\bottomrule

\end{tabulary}%
}
\end{table}%

\end{document}

with the following result (but it would be nice to be in landscape mode):

enter image description here

  • I saw it doesn't work... looking to fix it! – koleygr Jun 19 '17 at 16:20
  • Updated! I think this is what you want – koleygr Jun 19 '17 at 16:25
  • You are welcome... but still don't know which solution is your choice... You can improve it by choosing the desired length in C type columns – koleygr Jun 19 '17 at 17:03
  • first one is better because my real values are longer then 1, 2 and 3 due to which the table rows become wider when table width is kept fixed that extra row is because of this but still thanks alot – Shaggi3 Jun 19 '17 at 17:07
  • Ok, I would try to fix the table in my specific taste using both answers... The C column helps enough... also it would be better this kind of column in your "Steps"... try it – koleygr Jun 19 '17 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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