我想将表格居中放置在标题下方,但结果却是右对齐。
我尝试了,\begin{center}
但\begin{table}
结果相同。
\documentclass{article}
\usepackage{array}
\usepackage{multicol}
\usepackage{lineno}
\begin{document}
\title{Title:\\ more title}
\maketitle
\begin{table}[h]
\centering
\small
\setlength\tabcolsep{3pt}
\setlength\extrarowheight{2pt}
\begin{tabular}{llll}
\textsc{column 1} & \textsc{column 2} & \textsc{column 3}&
\textsc{column 4} \\ \hline
something here & something more here & something here a & something here \\
something here & something here & Rsomething more here & something here \\
something here & something here /something here & something here n & something more here \\
something more here & something more here & something here & something more here more \\
something here & something here & & something here
\end{tabular}
\end{table}
\end{document}
答案1
表格对于可用的文本宽度来说太大,请参阅 Christian Hupfer 的评论。
一条建议:
X
列tabularx
与列类似p
,但会自动使用可用空间,无需明确指定尺寸。只有表格才有宽度。\midrule
包装的booktabs
周围有适当的垂直空白,以获得更好的规则。\RaggedRight
通过允许连字符,使包ragged2e
变得更平滑。\raggedright
\hangindent=1em\hangafter1\relax
用于缩进单元格第一段中的后续行。\slash
而不是/
带有断点的斜线。
\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{multicol}
\usepackage{lineno}
\begin{document}
\title{Title:\\ more title}
\maketitle
\begin{table}[h]
\centering
\small
\setlength\tabcolsep{3pt}
\setlength\extrarowheight{2pt}
\begin{tabularx}{\linewidth}{*{4}{>{\hangindent=1em\hangafter=1\RaggedRight}X}}
\textsc{column 1} & \textsc{column 2} & \textsc{column 3}&
\textsc{column 4} \\ \midrule
something here & something more here & something here a & something here \\
something here & something here & Rsomething more here & something here \\
something here & something here\slash something here & something here & something more here \\
something more here & something more here & something here & something more here more \\
something here & something here & & something here
\end{tabularx}
\end{table}
\end{document}