1

I have the following table:

\begin{table}
\begin{tabular}{| c l |}
\hline
\multicolumn{2}{| c |}{\textbf{legenda}} \\ \hline
1 & lampade \\
2 & rete radio \\
3 & controllore locale \\
4 & controllore centrale \\
\end{tabular}
\end{table}

I'm trying to put text next to this table (top alignment), but I'm failing. To do what I want I tried to use these environments: minipage, tabular and wrapfigure.

Am I missing something?

2
  • use \begin{tabular}[t] to get top alignment then just add text as in \end{tabular} some words here Nov 6, 2015 at 10:06
  • If you use wrapfigure or wraptable, it replaces \begin{table}...\end{table}. Nov 6, 2015 at 15:42

1 Answer 1

2

I used \raisebox to remove the gaps normally placed above and below the table.

\documentclass{article}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}
\lipsum[1]

\begin{wraptable}{l}{0pt}% automatically uses minimum width
\raisebox{\baselineskip}[0pt][\dimexpr\depth-2\baselineskip]{% remove gaps above and below
\begin{tabular}[t]{| c l |}
\hline
\multicolumn{2}{| c |}{\textbf{legenda}} \\ \hline
1 & lampade \\
2 & rete radio \\
3 & controllore locale \\
4 & controllore centrale \\
\end{tabular}}
\end{wraptable}
\lipsum[2]
\end{document}

no gaps

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.