# How to specify row height and align the text vertically in middle of a cell?

How to align the text in middle by specifying the row height could someone help me.

The latex code is as follows..

    \begin{table}[htbp]
\centering
\begin{tabular}{|c|l|c|}
\hline
\textbf{\textit{fine/coarse}} & \textbf{Property} & \textbf{\textit{lamellar/equiaxed}} \\
\hline
x/x & Elastic Modulus & x/+ \\
\hline
+/- & Strength & -/+ \\
\hline
+/- & Ductility & -/+ \\
\hline
+/- & Fatigue crack initiation & -/+ \\
\hline
-/+ & Fatigur crack propagation & +/- \\
\hline
+/- & Oxidation Behaviour & +/- \\
\hline
\end{tabular}
\label{table:eomsomeprops}
\end{table}


Output is attached. I want something similar to this:

-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Mar 22 '14 at 10:26

Like this?

Code:

\documentclass{article}

\usepackage{array}

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
\newcolumntype{N}{@{}m{0pt}@{}}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabular}{|C{3cm}|L{4cm}|C{3.5cm}|N}
\hline
\textbf{\textit{fine/coarse}} & \textbf{Property} & \textbf{\textit{lamellar/equiaxed}} &\\[20pt]
\hline
x/x & Elastic Modulus & x/+ &\\[20pt]
\hline
+/- & Strength & -/+ &\\[20pt]
\hline
+/- & Ductility & -/+ &\\[20pt]
\hline
+/- & Fatigue crack initiation & -/+ &\\[20pt]
\hline
-/+ & Fatigur crack propagation & +/- &\\[20pt]
\hline
+/- & Oxidation Behaviour & +/- &\\[20pt]
\hline
\end{tabular}
\label{table:eomsomeprops}
\end{table}

\end{document}


I've defined two new types of columns (requires the array package)

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


which are fixed columns but center their contents vertically.

When you break a row, use something like \\[20pt] instead of simply \\ to have the correct spacing.

Also, a new column of type N so defined

\newcolumntype{N}{@{}m{0pt}@{}}


is needed as the last one to avoid the problem described here: Vertical alignment in table: m-column, row size - problem in last column.

-
Exactly what i expected thanks a lot!! –  Rahul Balmuri Mar 22 '14 at 10:28
@user48432 You're welcome. I've added some explanations. –  karlkoeller Mar 22 '14 at 10:31
My love to LAteX is growing infinetely. Awesome explanation :) (y) –  Rahul Balmuri Mar 22 '14 at 10:32