1

I'm trying to make a table with an image at one side

\documentclass{article}
\begin{document}    
\begin{table}[h!]
\centering
\begin{tabular}{c  p{5cm} }

\begin{tabular}{c c  c | c c } 
 \hline
 $S$ & $R$ & $CLK$ & $Q_{t+1}$  \\ 
 \hline
 0   & 0   & X     & $Q_t$   \\ 
  \hline
 0   & 1   & 1     & 0   \\
  \hline
 1   & 0   & 1     & 1   \\
  \hline
 1   & 1   & 1     & $Error$   \\
 \hline
\end{tabular}
&
\includegraphics[scale=0.3]{RSflipflop}
\end{tabular}

\caption{Esquema de un Biestable RS síncrono}
\label{table:1}
\end{table}
\end{document}

enter image description here

I just want to get the image and the table with the same "top" (the image doesn't have white pixels)

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 9 '15 at 12:15
1

Use c column type instead of p type, use [t] for inner tabular and use \raisebox for the picture.

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{c  c }

\begin{tabular}[t]{c c  c | c c }
 \hline
 $S$ & $R$ & $CLK$ & $Q_{t+1}$  \\
 \hline
 0   & 0   & X     & $Q_t$   \\
  \hline
 0   & 1   & 1     & 0   \\
  \hline
 1   & 0   & 1     & 1   \\
  \hline
 1   & 1   & 1     & $Error$   \\
 \hline
\end{tabular}
&
\raisebox{-\height}{\includegraphics[scale=0.1]{example-image}}
\end{tabular}

\caption{Esquema de un Biestable RS síncrono}
\label{table:1}
\end{table}
\end{document}

enter image description here

  • The outer tabular is not needed BTW. – user11232 Apr 9 '15 at 12:35
  • thanks a lot :), I tried with \raisebox{-\height} but didn't know about the inner tabular – lcjury Apr 9 '15 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.