69

I would like to wrap some text around a tabular as the figure shows.

Do I have to use minipage and fix the width of the table, and the width of the text on the left hand?

Isn't there a simpler way?

enter image description here

4 Answers 4

65

This is a MWE for David's answer (supplement).

\documentclass{article}
\usepackage{wrapfig,lipsum,booktabs}
%------------------------------------------
\begin{document}
This is where the table goes with text wrapping around it. You may 
embed tabular environment inside wraptable environment and customize as you like.
%------------------------------------------
\begin{wraptable}{r}{5.5cm}
\caption{A wrapped table going nicely inside the text.}\label{wrap-tab:1}
\begin{tabular}{ccc}\\\toprule  
Header-1 & Header-1 & Header-1 \\\midrule
2 &3 & 5\\  \midrule
2 &3 & 5\\  \midrule
2 &3 & 5\\  \bottomrule
\end{tabular}
\end{wraptable} 
%------------------------------------------
{\lipsum[2] 
\par
Table~\ref{wrap-tab:1} is a wrapped table.
%------------------------------------------
\end{document}

enter image description here

3
  • 1
    Is there a configuration for page-end? In my case when it's at the end of a page, it overflows the page margins instead of going into next page.
    – fatih
    Dec 10, 2017 at 14:34
  • 1
    @fatih, here's a similar (answered) question.
    – Igor
    Jul 18, 2018 at 19:23
  • @Igor, thanks. that seems to be what I was looking for.
    – fatih
    Jul 19, 2018 at 20:32
16

The wrapfig package provides this functionality.

1
  • 3
    Example please.
    – Exploring
    Jan 1 at 8:41
1

Like in the example above, but use capital letters for R and L to avoid huge amounts of white space with the table flowing into the margins

Change: \begin{wraptable}{r}{5.5cm}

To

\begin{wraptable}{R}{5.5cm}

This issue is also discussed in this post: Handling of wrapfig pictures in LaTeX

0

One solution to this is using \begin{wraptable} to wrap around the table (outside \tabular) .

\begin{wraptable}{r}{5.5cm}
\caption{A wrapped table going nicely inside the text.}\label{wrap-tab:1}
\begin{tabular}{ccc}\\\toprule  
Header-1 & Header-1 & Header-1 \\\midrule
2 &3 & 5\\  \midrule
2 &3 & 5\\  \midrule
2 &3 & 5\\  \bottomrule
\end{tabular}
\end{wraptable} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .