2

I am inserting several images inside cells of a table, but instead of readjusting the height of the cell, the figure gets overlapped with some horizontal lines, and I don´t know how to fix it.

My preambule is:

\documentclass[12pt]{article}
\usepackage[letterpaper, left=2.8cm, right=2.8cm, top=2.5cm, bottom=2.5cm]{geometry}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[document]{ragged2e}
\usepackage[usenames,dvipsnames,svgnames,table, xcdraw]{xcolor}
\usepackage{multirow}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{tabularx}

Here is the table´s code:

\begin{table}[H]
\caption{Peligrosidad de los compuestos empleados}
\label{tab:pe}
\centering
\begin{tabular}{>{\centering\arraybackslash}m{2cm} >{\arraybackslash}c }
\hline
\textbf{Compuesto} & \textbf{Peligrosidad} \\
\hline \hline
Aceite de Girasol & Ninguna conforme al Reglamento no 1272/2008/CE. \\
\hline
NaOH & \includegraphics[scale=0.8]{Screenshot_2.png} \\
\hline
EtOH & \includegraphics[scale=0.8]{1.png} \\
\hline
Jabón & Ninguna conforme al Reglamento no 1272/2008/CE. \\
\hline
Glicerina &  \includegraphics[scale=0.8]{Glicerol.png}
 \\
\hline
\end{tabular}
\end{table}

enter image description here

1 Answers1

1

If this code is good enough for you, possibly the answer of @StevenB.Segletes here is what you were looking for...

\documentclass{article}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}
\usepackage{verbatimbox}
\let\oldincludegraphics\includegraphics
\renewcommand\includegraphics[2][]{\addvbuffer[3pt 0pt]{\oldincludegraphics[#1]{#2}}}
\begin{document}
\begin{table}[H]
\caption{Peligrosidad de los compuestos empleados}
\label{tab:pe}
\centering
\begin{tabular}{>{\centering\arraybackslash}m{2cm} >{\centering\arraybackslash} m{\dimexpr\linewidth-3cm\relax} }
\hline
\textbf{Compuesto} & \textbf{Peligrosidad} \\
\hline \hline
Aceite de Girasol & Ninguna conforme al Reglamento no 1272/2008/CE. \\
\hline
NaOH & \includegraphics[scale=0.8]{Screenshot_2.png} \\
\hline
EtOH & \includegraphics[scale=0.8]{1.png} \\
\hline
Jabón & Ninguna conforme al Reglamento no 1272/2008/CE. \\
\hline
Glicerina &  \includegraphics[scale=0.8]{Glicerol.png}
 \\
\hline
\end{tabular}
\end{table}
\end{document}
Bernard
  • 271,350
koleygr
  • 20,105