开发者

Simple way to inset table? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
开发者_Python百科

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I'm a LaTeX beginner. Up until now whenever I've created a table (using the tabular environment) LaTeX floats it in its own paragraph, between my lines of text.

However, I want a way to embed a small table within a paragraph (to the left or right), having the text flow around it. Is there a simple way to do this without having to exert too much manual control over the formatting?


\begin{wraptable}{O}{0.5\columnwidth}
% 0.5\columnwidth is 50% of the width for text. It will wrap to the "outer"
% of the current page, and thus if you have double-sided print, it'll still look
% good.
\begin{centering}
% The centering will look nice (else it's left-aligned, which isn't nice)
\begin{tabular}{|c|c|}
% Having your own tabular here.
\hline
Hello & World\tabularnewline
\hline
\hline 
Stack & Overflow!\tabularnewline
\hline
% End of content.
\end{tabular}
\par % Add for spacing
\end{centering}
\caption{Test Table}
% Enter your caption (a float having a caption looks cool)
\end{wraptable}

This will let the tabular wrap & float. This looks similar to the floats in HTML, if you're familiar with them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜