谢谢你的帮助。当我使用以下代码时,创建的表格超出了页面范围。如何使用 tabu 将表格保留在页面中?此外,我希望第一列不超过定义的宽度,并且文本在此处换行。
谢谢
\renewcommand{\arraystretch}{1.5}
\centering
\begin{tabu}{*{7}{x[c]}}
\toprule
Name & Company & Lot & Purchased & Concentration & Date created & Location \\
\midrule
XE991 \geq 98\% & Sigma & 026M4737V & 4.8.2020 & Solid & - & Room 2.38 \\
XE991 $>$ 95\% & alomone & X100SMO150 & 8.2020 & Solid & - & Room 2.38 \\
Paracetamol & MCE & 16369 & 7.2020 & Solid & - & Room 2.38 \\
Retigabine dihydrochloride & Acros Organics & A0412371 & 6.2020 & Solid & - & Room 2.38 \\
\bottomrule
\end{tabu}
\label{tab:Standards 4 Degrees}
\end{table}
答案1
(红线表示文字边框)
相反,tabu 会使用新的表包tabularray
:
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\begin{document}
\begin{table}
\centering
\begin{tblr}{hline{1,Z}={1pt}, hline{2}=0.6pt,
colspec={X[1.3,l,m] X[0.9,l,m] X[1.2,l,m] *{4}{X[0.9,l,m]}},
colsep=3pt, rowsep=3pt
}
Name
& Company & Lot & Purchased & Concen\-tration
& Date created
& Location \\
XE991 $\geq \qty{98}{\%}$
& Sigma & 026M4737V & 4.8.2020 & Solid & - & Room 2.38 \\
XE991 $> \qty{95}{\%}$
& alomone & X100SMO150 & 8.2020 & Solid & - & Room 2.38 \\
Paracetamol
& MCE & 16369 & 7.2020 & Solid & - & Room 2.38 \\
Retigabine dihydrochloride
& Acros Organics & A0412371 & 6.2020 & Solid & - & Room 2.38 \\
\end{tblr}
\label{tab:Standards 4 Degrees}
\end{table}
\end{document}