![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
"It is practically a big lie
that LaTeX makes you focus on the content
without bothering about the layout"
user xport
"У вас есть такой же, но с перламутровыми пуговицами?
- Нет.
- Будем искать!"
К\ф"Бриллиантовая рука"
It is very simple to align text in the table in LaTeX horizontally, but hard to do it vertically. You can use column types {p} or [m], but also you have to set fixed column width. That is bad.
Google proposes lot of answers for query "How to vertically-center the text of the cells latex" how to solve this problem, but almost all of them require the fixed width.
But there is one simple solution.
Example of the problem:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{tabular}{|c|c|c|}
\hline
\# & Image 1 & Image 2\\
\hline
1
& \includegraphics{2.jpg}
& \includegraphics{3.jpg}\\
\hline
\end{tabular}
\end{document}


Bottom whitespaces don`t look very nice, no whitespaces at the top - too.
All you need - is to use tabu package.
If you use MikTeX under Windows, you can just install this package using standard installer.
With ubuntu (if you don`t want to compile and install it manually), the easiest way is to install texlive-latex-extra, which contains tabu as well:
sudo apt-get install texlive-latex-extra
If you use MikTeX under Windows, you can just install this package using standard installer.
With ubuntu (if you don`t want to compile and install it manually), the easiest way is to install texlive-latex-extra, which contains tabu as well:
sudo apt-get install texlive-latex-extra
After intallation you can just write
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabu}
\begin{document}
\begin{tabu}spread 0pt{|X[-1m,c]|X[-1m,c]|X[-1m,c]|}
\hline
\# & Image 1 & Image 2\\
\hline
1
& \includegraphics{2.jpg}
& \includegraphics{3.jpg}\\
\hline
\end{tabu}
\end{document}

Now it is symmetrical, but if you are not running out of space, it is better to add some whitespaces
\tabulinesep=0.5mm
\begin{tabu}spread 0pt{|X[-1m,c]|X[-1m,c]|X[-1m,c]|}

Now it looks much better.

Now it looks much better.