LaTeX forum ⇒ Graphics, Figures & TablesRotate a table and should not move it to next page (PDF screen shot attached) Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Rotate a table and should not move it to next page (PDF screen shot attached)

Postby Matam » Fri Jun 08, 2018 1:05 pm

Please see the attachment and give me a solution to rotate the table and not move it to next page.
Attachments
Appendix_screenshot.png
Appendix_screenshot.png (273.57 KiB) Viewed 277 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8945
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jun 08, 2018 1:58 pm

You could use this:

  1. \usepackage{rotating}
  2. \begin{document}
  3. ...
  4. \begin{sidewaystable}
  5. \centering
  6. \caption{Your table caption}
  7. \begin{tabular}{...}
  8. ...
  9. \end{tabular}
  10. \end{sidewaystable}


Stefan
Site admin

Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Postby Matam » Sat Jun 09, 2018 7:33 am

I did add the code as you told. The good part is that table is rotated. BUt, it still appeared in second page by keeping the first page blank. Please, check the attached PDF screen shot.
Attachments
rotateerror.png
rotateerror.png (135.17 KiB) Viewed 256 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8945
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Jun 09, 2018 4:03 pm

Or rotate this way:

  1. \usepackage[graphicx]{realboxes}
  2. \usepackage{varwidth}
  3. ...
  4. \begin{document}
  5. ...
  6. \begin{table}[!htbp]
  7. \centering
  8. \rotatebox{90}{%
  9. \begin{varwidth}{\textheight}
  10. \caption{the caption text}\label{tab:1}
  11. \begin{tabular}{...}
  12. ...
  13. \end{tabular}
  14. \end{varwidth}}
  15. \end{table}

\end{document}[/code]

Stefan
Site admin

Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Postby Matam » Sat Jun 09, 2018 6:15 pm

Sorry. It did not work at all.

I added those two packages mentioned by you and Here is the code I entered:

  1. \begin{table}[!htbp]
  2. \centering
  3. \rotatebox{90}{%
  4. \begin{varwidth}{\textheight}
  5. \caption{Switch comparison}
  6. \begin{tabular}{|c|c|c|c|c|c|}
  7. \hline
  8. \multirow{2}{*}{Particulars} & \multicolumn{5}{c|}{per unit} \\ \cline{2-6}
  9. & IGBT\cite{igbt}& \gls{spst} \cite{spstdpst} & \gls{spdt} \cite{digikey} & \gls{dpst}\cite{spstdpst} & \gls{dpdt}\cite{dpdt} \\ \hline
  10. Size(in mm)&20x16x5&10x7x5&18x14 $\times$ 15&20x10x11&29x25x13 \\ \hline
  11. AC Rating & 1200V, 5A & 250V,5A & 250V,5A & 250V,5A&250V,5A \\ \hline
  12. \begin{tabular}[c]{@{}c@{}}Conduction loss \\ P$_{con}$ (in W)\end{tabular} & \begin{tabular}[c]{@{}c@{}}13.5$^{**}$\end{tabular} & 2.5&2.5&2.5&2.5 \\ \hline
  13. \begin{tabular}[c]{@{}c@{}}Gate loss \\ P$_{gate}$ (in W)\end{tabular} & \begin{tabular}[c]{@{}c@{}}DNA\end{tabular} & 0.75&0.4&0.75&0.54 \\ \hline
  14. %\begin{tabular}[c]{@{}c@{}}Perday loss(Whr)$^*$\end{tabular} & 130.5&25& 13.4 \\ \hline
  15. %\begin{tabular}[c]{@{}c@{}}Switching time($T_{on}$+$T_{off}$)\end{tabular}& 1.8+2.0= 3.8$\mu$s &3.3ms & 6+4=10ms \\ \hline
  16. \begin{tabular}[c]{@{}c@{}}Switching time\end{tabular}& 3.8$\mu$s &3.3ms& 10ms &5ms&15ms \\ \hline
  17. Elect. cycles &-&3x10$^4$& 10$^5$& 3x10$^4$& 10$^5$ \\ \hline
  18. Mech. cycles & -& 10$^7$ & 5x10$^6$& 10$^7$& 10$^7$ \\ \hline
  19. Operating temp. & $+150^{\circ}$C &\begin{tabular}[c]{@{}c@{}} -40 - +$85^{\circ}$C \end{tabular} &\begin{tabular}[c]{@{}c@{}} -40 - +$70^{\circ}$C \end{tabular} &\begin{tabular}[c]{@{}c@{}} -40 - +$85^{\circ}$C \end{tabular} &\begin{tabular}[c]{@{}c@{}} -30 - +$70^{\circ}$C \end{tabular} \\ \hline
  20. \begin{tabular}[c]{@{}c@{}}market cost (in \$) \end{tabular} & 30.38 &3.59 & 2.05 &3.59&3.77\\ \hline
  21. \end{tabular}
  22. %}
  23. \\
  24. ~~**~$I_{CE}$=5A,$V_{CE}$=2.7V;DNA Data not available;
  25. %\end{sidewaystable}
  26. \end{varwidth}}
  27. \end{table}

User avatar
Stefan Kottwitz
Site Admin
Posts: 8945
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jun 10, 2018 11:53 am

You could use a minipage instead of varwidth. Choose the height as option, as it fits. I used 0.9\textheight.

  1. text
  2. \begin{table}[!htbp]
  3. \centering
  4. \rotatebox{90}{%
  5. \begin{minipage}{0.9\textheight}
  6. \caption{Switch comparison}
  7. \begin{tabular}{|c|c|c|c|c|c|}
  8. ...
  9. \end{tabular}
  10. \end{minipage}}
  11. \end{table}
  12. text


Stefan
Site admin

Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Postby Matam » Sun Jun 10, 2018 3:56 pm

Excellent. Thanks a ton Stefan. It worked for me. Please, find the screen shot.
Attachments
tableDONE.png
tableDONE.png (85.78 KiB) Viewed 213 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8945
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jun 10, 2018 4:03 pm

The varwidth environment was for auto-adjusting the width (here: hight, as it's rotated), somehow it did not work with the content here. But as it works with minipage, fine. :-)

Stefan
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests