我在简历的个人信息表方面遇到了问题,我不知道如何对齐图标后的文本并将其垂直居中,这样它就不会出现在单元格的底部。我还查看了一些有类似但更复杂问题的帖子,但我无法很好地理解它们,更不用说优化它们对这个简单表格的解决方案了。
我的代码是:
\documentclass[10pt,letterpaper,onecolumn]{article}
\usepackage{graphicx}
\begin{document}
\begin{table}
\begin{tabular}{c c c c c c}
\hline
\includegraphics[height=0.5cm]{Email_Icon} & ONEONEONE & \includegraphics[height=0.5cm]
{SmartPhone_Icon} & ONEONEONE & ~~~\includegraphics[height=0.6cm]{Language_Icon} &
ONEONEONE \\
\includegraphics[height=0.6cm]{Birthday_Icon} & ONEONEONE &
\includegraphics[height=0.5cm]{Nationality_Icon} & ONEONEONE &
\includegraphics[height=0.6cm]{Location_Icon} & ONEONEONE \\
\hline
\end{tabular}
\end{table}
\end{document}
答案1
像这样:
使用该adjustbox
包:
\documentclass[10pt,letterpaper,onecolumn]{article}
\usepackage{tabularx}
\usepackage[demo, % in real document delete demo option
export]{adjustbox} % it load graphicx package
\begin{document}
\begin{table}
\adjustboxset{height=6mm, width=9mm, % in real document remove width setting
valign=c, margin=0pt 3pt 0pt 3pt}
\begin{tabularx}{\linewidth}{c X c X c X}
\hline
\adjustimage{}{Email_Icon} & ONEONEONE
& \adjustimage{}{SmartPhone_Icon} & ONEONEONE
& \adjustimage{}{Language_Icon} & ONEONEONE \\
\adjustimage{}{Birthday_Icon} & ONEONEONE
& \adjustimage{}{Nationality_Icon} & ONEONEONE
& \adjustimage{}{Location_Icon} & ONEONEONE \\
\hline
\end{tabularx}
\end{table}
\end{document}