答案1
这里我使用 ,\makebox[\textwidth]{}
在其中放置了比 更宽的东西\textwidth
。虽然我在 里面展示了它table
,但这并不是采用这种技术的必要条件。
\documentclass{article}
\usepackage{lipsum,tabularx}
\begin{document}
\lipsum[1]
\begin{table}[ht]
\makebox[\textwidth]{\begin{tabularx}{1.2\textwidth}{|c|c|X|}
\hline
This & is & a test\\
\hline
\end{tabularx}}
\end{table}
\lipsum[2]
\end{document}
答案2
以下是如何在adjustwidth
环境中执行此操作:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{changepage}
\usepackage{ragged2e, lipsum}
\usepackage{tabularx, caption, booktabs}
\begin{document}
\lipsum[1]
\begin{table}[!htb]
\centering
\captionsetup{singlelinecheck=off, skip =4pt}
\begin{adjustwidth}{-0.12\textwidth}{-0.12\textwidth}
\caption{A wide table}\label{tab:wide}
\begin{tabularx}{\linewidth}{@{}>{\RaggedRight}X@{}}
\toprule
Sed feugiat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Ut pellentesque augue sed urna. Vestibulum diam eros, fringilla et, consectetuer eu, nonummy id,
sapien. Nullam at lectus. In sagittis ultrices mauris. Curabitur malesuada erat sit amet massa. Fusce
blandit. Aliquam erat volutpat. Aliquam euismod. Aenean vel lectus. Nunc imperdiet justo nec do-
lor. \\
\bottomrule
\end{tabularx}
\end{adjustwidth}
\end{table}
\lipsum[2]
\end{document}
答案3
我们希望保持简单,并将 放在tabular
里面\makebox
。
\textwidth
实际tabular
材料会很好地居中。
\documentclass{article}
\pagenumbering{gobble}
\usepackage{lipsum}
\usepackage[showframe,a4paper]{geometry}
\begin{document}
\lipsum[1]
\begin{table}[!tb]
\makebox[\textwidth][c]{%
\begin{tabular}{p{0.4\textwidth}p{0.4\textwidth}p{0.4\textwidth}}
\hline
\lipsum[1]&\lipsum[1]&\lipsum[1]\\
\hline
\end{tabular}}
\caption{This table is wider than the page.}
\label{tab:toowide}
\end{table}
\lipsum[2]
\end{document}