嘿夥計們,看看上面給出的圖片。我希望(續)完全左對齊,但是,leftalign 在 tabularx (ltablex) env 中不起作用。對我來說,因此我使用 \hfill。雖然 hfill 在一定程度上起作用,但不會產生完整的左對齊。有修改山的解決方案或任何其他解決方案來解決這個問題嗎?謝謝。
\documentclass{article}
\usepackage{ltablex}
\usepackage{threeparttable}
\usepackage{booktabs}
\title{Document}
\begin{document}
\maketitle
\begin{tabularx}{\textwidth}{Xc}
\toprule\toprule
Some random text & 1,75,650\\\midrule
\multicolumn{2}{l}{\textbf{Panel A1: AAA}} \\\midrule
Number of observations ... & 1,75,650\\
Delete: ... & (78,420)\\
Delete: ... & (7,104)\\
Final sample & 90,126\\
Delete: & (2,143)\\
Delete: & (8,345)\\
Final sample & 79,638\\\midrule
\multicolumn{2}{l}{\textbf{Panel A2: AAA}} \\\midrule
Number of observations & 79,638\\
Delete: & (39,540)\\
Delete: & (7,979) \\
Final sample & 32,119 \\\midrule
\multicolumn{2}{l}{\textbf{Panel B1: BBB }} \\\midrule
Number of observations & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule
\multicolumn{2}{l}{\textbf{Panel B2: BBB}} \\\midrule
Number of observations & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Number of observations & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule\bottomrule
\end{tabularx}
\end{document}
答案1
既然您談到tabularx
:在表格環境中,列之前和之後都有空間。您可以透過@{}
在列定義的相應位置插入來刪除它,例如:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{4cm}{@{}Xr@{}}
\hline
Number & 42\\
\hline
\end{tabularx}
\end{document}
類似,如果您使用\multicolumn
:
\multicolumn{2}{@{}l}{...}
您的 MWE 變成:
在您的“繼續”行的情況下,使用\multicolumn
而不是\hfill
:
\bottomrule\multicolumn{2}{@{}r@{}}{\small\textit{(Continued)}}\endfoot