I am inserting multiple figures into a table, and would like to make the following change:
-
center the text (1st column) in the cell (all the text currently are at the bottom)
-
center the figures (2nd and 3rd column) so that it doesn't cut the horizontal lines. The figures all have slightly different size. Is there a way to auto-adjust the height of each row so that all figures will fit it?
-
If possible, I would like to show some of the long text in two rows. For example, instead of :
Inverting op-amp (linear amplifier)
I want it to be in two lines, both horizontally centered in the cell:
Inverting op-amp (linear amplifier)
Any suggestions would be highly appreciated! Thanks!
Here is my latex code:
\begin{table}[ht]
\centering
\begin{tabular}{ p{4.5cm} p{5cm} p{5cm} } % centered columns (3 columns)
\hline\hline %inserts double horizontal lines
Building Block & Circuits & Frequency Response \\ [0.5ex] % inserts table heading
\hline
Inverting op-amp
(linear amplifier)
& \includegraphics[height=1in]{figures/servoblockAB.png}& \includegraphics[height=1in]{figures/servoblockAC.png} \\ [1ex]
\hline
Integrator
& \includegraphics[height=1in]{figures/servoblockBB.png}& \includegraphics[height=1in]{figures/servoblockBC.png} \\
\hline
AC integrator with DC gain
& \includegraphics[height=1in]{figures/servoblockCB.png}& \includegraphics[height=1in]{figures/servoblockCC.png} \\
\hline
Differentiator
& \includegraphics[height=1in]{figures/servoblockDB.png}& \includegraphics[height=1in]{figures/servoblockDC.png} \\
\hline
AC differentiator with DC gain
& \includegraphics[height=1in]{figures/servoblockEB.png}& \includegraphics[height=1in]{figures/servoblockEC.png} \\
\hline
\end{tabular}
\caption{A few basic circuit blocks and their frequency response for servo design.}
\label{table4.2}
\end{table}
Best Answer
I made
\Includegraphics
(cap I) to insert a picture shifted down half its height. I also used some\linebreak
s and\raggedright
s.I also added some gap above/below the pictures, as requested with
\addstackgap
. I can take an optional argument (default 3pt) to specify the gap.