居中,宽浮动

居中,宽浮动

可能重复:
平衡比文档宽度更宽的图形

我有一张桌子只是对于页面来说太宽。

我希望能够使其浮动,并使其位于文本的中心,但浮动时会“忽略”边框 --- 也就是说,如果它比边距更宽,它仍然位于中心,并尊重周围的文本。

请注意,编译以下示例时,所有内容都会保留在应有的位置,只是表格左侧不齐,超出了右边距。一个好的解决方案是只移动表格,保留标题和所有垂直间距。

\documentclass[12pt,draft]{article}

\begin{document}

    Blah blah blah blah, said the author, Bob Loblaw on the Bob Loblaw Law Blog. 
    Indeed, that's some bum, Samson, said Sesame Steve, spiritual starter of Sesame Street and sometime successor of some stuff.

    \begin{table}[h]
        \centering
        \begin{tabular}{lllllllllllllll}
        A very  & very  & very  & very  & very  & very  & very  & very  & very  & very  & very wide table.
        \end{tabular}
        \caption{Centered, just-so.}
    \end{table}

    \par

    More text, textifyingly textual in its texterity, contextualises the context with respect left intact.

\end{document}

答案1

您可以将其放入命令tabular\makebox

\makebox[\linewidth]{\begin{tabular}{lllllllllllllll}
A very  & very  & very  & very  & very  & very  & very  & very  & very  & very  & very wide table.
\end{tabular}}

答案2

我发现在这种情况下(假设是一次性的)最简单的解决方案就是引入一个\hskip合适的否定词。

\documentclass{book}
\begin{document}
 Blah blah blah blah, said the author, Bob Loblaw on the Bob Loblaw Law Blog. 
 Indeed, that's some bum, Samson, said Sesame Steve, spiritual starter of Sesame Street and sometime successor of some stuff.
 \begin{table}[h]
   \hskip-25pt \begin{tabular}{lllllllllllllll}
       A very  & very  & very  & very  & very  & very  & very  & very  & very  & very  & very wide table.
        \end{tabular}
    \caption{Centered, just-so.}
\end{table}

\par

    More text, textifyingly textual in its texterity, contextualises the context with respect left intact.

\end{document}

相关内容