I use the following code to render a table in LaTeX. But the problem is that the default row height is too big for me. I want to be able to specify the row height. How can i do it?
\begin{tabular}{|p{5cm}|p{2.5cm}|}
\hline
File & size \\ \hline
hello_world & 1mb\\ \hline
helloworld2 kB & 64kb \\
\hline
\end{tabular}
Can someone please help.
Best Answer
One option could be using a modified
\arraystretch
:Also see Column padding in tables for more options on horizontal and vertical padding.
For centered horizontal alignment of the columns, you could use the column specifier
c
(which will default to a natural-width column) or use>{\centering\arraybackslash}p{<len>}
. For centered vertical alignment of the columns, you could use the column specifierm{<len>}
. For both, use>{\centering\arraybackslash}m{<len>}
. The last two settings require thearray
package: