Vertical alignment (top, center, bottom) of figure and two texts in tabular
Based on Tabular alignment of text and figure, my question is how can I get t, c, b alignment of all 3 elements that make part of tabular. The t and c works fine, but not the b.
\documentclass[10pt,a4paper]{scrartcl}
\usepackage[pass,showframe]{geometry}
\usepackage{graphicx}
\usepackage{array}
\usepackage{varwidth}
\newcommand*{\mtab}[2][]{\begin{tabular}[#1]{@{}l@{}} #2 \end{tabular}}
\newcommand*{\pbox}[2][c]{\mtab[#1]{\begin{varwidth}[#1]{\linewidth}#2\end{varwidth}}}
\newcommand*{\Logo}{\includegraphics[width=\linewidth]{example-image}}
\begin{document}
\begingroup
\noindent
\begin{tabular}{@{}p{0.15\textwidth}<{\hfill}>{\centering}p{0.5\textwidth}>{\hfill}p{\dimexpr 0.35\textwidth-4\tabcolsep\relax}@{}}
\pbox[b]{\raisebox{\dimexpr-\height+\ht\strutbox\relax}{\Logo}} & \pbox[b]{aaa\\ bbb\\ ccc\\ ddd} & \pbox[b]{eee\\ fff\\ hhh hhh hhh hhh hhh hhh}
\end{tabular}
\endgroup
\end{document}
Based on Tabular alignment of text and figure, my question is how can I get t, c, b alignment of all 3 elements that make part of tabular. The t and c works fine, but not the b.
\documentclass[10pt,a4paper]{scrartcl}
\usepackage[pass,showframe]{geometry}
\usepackage{graphicx}
\usepackage{array}
\usepackage{varwidth}
\newcommand*{\mtab}[2][]{\begin{tabular}[#1]{@{}l@{}} #2 \end{tabular}}
\newcommand*{\pbox}[2][c]{\mtab[#1]{\begin{varwidth}[#1]{\linewidth}#2\end{varwidth}}}
\newcommand*{\Logo}{\includegraphics[width=\linewidth]{example-image}}
\begin{document}
\begingroup
\noindent
\begin{tabular}{@{}p{0.15\textwidth}<{\hfill}>{\centering}p{0.5\textwidth}>{\hfill}p{\dimexpr 0.35\textwidth-4\tabcolsep\relax}@{}}
\pbox[b]{\raisebox{\dimexpr-\height+\ht\strutbox\relax}{\Logo}} & \pbox[b]{aaa\\ bbb\\ ccc\\ ddd} & \pbox[b]{eee\\ fff\\ hhh hhh hhh hhh hhh hhh}
\end{tabular}
\endgroup
\end{document}
No comments:
Post a Comment