LaTeX forum ⇒ Graphics, Figures & TablesLatex: Image on the left and table on the right

Information and discussion about graphics, figures & tables in LaTeX documents.
allawi
Posts: 3
Joined: Mon Feb 04, 2019 6:36 pm

Latex: Image on the left and table on the right

Postby allawi » Mon Feb 04, 2019 6:44 pm

Hi there,

I'm looking to create a table that has an image on the left showing the component. I have an example in the image attach, I'm trying to replicate this.

This is how i want it to look like.
test.png
test.png (50.45 KiB) Viewed 429 times

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 04, 2019 7:42 pm

Welcome to the forum.
  1. \documentclass{article}
  2.  
  3. \usepackage{adjustbox}
  4. \begin{document}
  5.  
  6. \begin{table}
  7. \adjustimage{width=3cm,valign=c}{example-image}\quad%
  8. \begin{tabular}{ll}
  9. Model & blurred \\
  10. $V_\mathrm{in}$ & blurred \\
  11. $V_\mathrm{out}$ & blurred \\
  12. $I_{\max}$ & blurred \\
  13. Features & blurred \\
  14. Features & blurred \\
  15. Features & blurred \\
  16. Features & blurred \\
  17. Features & blurred \\
  18. Features & blurred \\
  19. \end{tabular}
  20. \end{table}
  21.  
  22. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

allawi
Posts: 3
Joined: Mon Feb 04, 2019 6:36 pm

Postby allawi » Mon Feb 04, 2019 7:59 pm

Thank you Johannes for your quick replay and welcoming. I have tried your code but it is not aligning a 100% attaching the results.

test.png
test.png (60.44 KiB) Viewed 426 times


This is the code I have added
  1. \begin{table}
  2. \adjustimage{width=3cm,valign=c}{Illustrations/QFN-40-Backside}\quad%
  3. \caption{Table for test} \label{fig:test}
  4. \begin{tabular}{ll}
  5. Model & blurred \\
  6. $V_\mathrm{in}$ & blurred \\
  7. $V_\mathrm{out}$ & blurred \\
  8. $I_{\max}$ & blurred \\
  9. \end{tabular}
  10. \end{table}

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 04, 2019 9:09 pm

Without testing the code, the caption should come first. Please try.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

allawi
Posts: 3
Joined: Mon Feb 04, 2019 6:36 pm

Postby allawi » Tue Feb 05, 2019 1:37 am

Johannes_B wrote:Without testing the code, the caption should come first. Please try.


That worked, thank you. One last question please.

The current alignment of caption is a bit off from the table. Is it possible to make it centered as well?

test.png
test.png (114.9 KiB) Viewed 403 times

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Feb 05, 2019 7:45 am

Just add \centering after \begin{table}.
  1. \documentclass{article}
  2.  
  3. \usepackage{adjustbox}
  4. \usepackage{caption}
  5. \usepackage{showframe}
  6. \begin{document}
  7.  
  8. \begin{table}
  9. \caption{The following is not about Wombats}
  10. \centering
  11. \adjustimage{width=3cm,valign=c}{example-image}\quad%
  12. \begin{tabular}{ll}
  13. Model & blurred \\
  14. $V_\mathrm{in}$ & blurred \\
  15. $V_\mathrm{out}$ & blurred \\
  16. $I_{\max}$ & blurred \\
  17. Features & blurred \\
  18. Features & blurred \\
  19. Features & blurred \\
  20. Features & blurred \\
  21. Features & blurred \\
  22. Features & blurred \\
  23. \end{tabular}
  24. \end{table}
  25.  
  26. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests