在此代码(\captionof{table}{111}
)之前缩进是正常的,在此代码之后缩进消失。当我删除它时,缩进是正常的。那么,如何为这个 tabularx 添加标题(caption)?
%\usepackage{indentfirst}%doesn't do anything to solve the problem
%\setlength{\parindent}{2em}%doesn't do anything to solve the problem
\noindent\setlength\tabcolsep{4pt}
\captionof{table}{11111}\label{11}
\begin{tabularx}{\textwidth}{sssbbbs}
\toprule
11 & 111 & 11 & 1111 & 11 & 11 & 11 \\ [0.5ex]
\midrule
111 & 111 & 2020 & 111 & 111 & 111 & 111 \\
111 & 111 & 2020 & 111 & 111 & 111 & 11 \\
\bottomrule
\end{tabularx}
答案1
我明白了!
添加\usepackage{ltablex}%Table package extensions
并删除\captionof{table}{11111}\label{11}
,\caption{111}\label{11}\\
像tabularx
这样添加:
\begin{tabularx}{\textwidth}{sssbbbs}
\caption{111}\label{11}\\
\toprule
11 & 111 & 11 & 1111 & 11 & 11 & 11 \\ [0.5ex]
\midrule
111 & 111 & 2020 & 111 & 111 & 111 & 111 \\
111 & 111 & 2020 & 111 & 111 & 111 & 11 \\
\bottomrule
\end{tabularx}