TeX - LaTeX Asked on November 28, 2020
Consider following MWE :
documentclass{report}
usepackage{tabularx}
usepackage{graphicx}
begin{document}
begin{tabular}{|c|c|}
hline a & b hline
rotatebox[origin=c]{90}{Hello} & d hline
e & f hline
end{tabular}
vspace{1cm}
begin{tabular}{|c|c|}
hline a & b hline
rotatebox[origin=c]{90}{There} & includegraphics[height=2cm]{dummy.png} hline
e & f hline
end{tabular}
end{document}
In the second line of the first table, the rotated text ("Hello") is vertically aligned with the text ("d") of its adjacent cell.
In the second table, there is a problem with the vertical alignment : the text seems to be aligned at the bottom [or left before rotation], and there is a whitespace below the figure. How can one obtain vertical alignment in this case?
I found this related question but it seems my problem is caused by the fact of adding an image in the adjacent cell.
For the second table with image:
documentclass{report}
usepackage{tabularx}
usepackage[export]{adjustbox}
begin{document}
begin{tabular}{|c|c|}
hline a & b hline
rotatebox[origin=c]{90}{There}
& includegraphics[height=2cm,valign=c,
margin= 0pt 3pt 0pt 3pt]{example-image-duck}
hline
e & f
hline
end{tabular}
end{document}
Answered by Zarko on November 28, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP