我有以下代码示例,用于构建类似功能的目录
\documentclass[11pt,a4paper]{book}
\usepackage{array}
\makeatletter
\renewcommand \dotfill {\leavevmode \cleaders \hb@xt@ 1.0em{\hss .\hss }\hfill \kern \z@}
\makeatother
\begin{document}
\begin{tabular}{p{5.5in}r}
Apple\dotfill & 1\\
Banana\dotfill & 12\\
Orange\dotfill & 140\\
Watermelon\dotfill & 180\\
\end{tabular}
\end{document}
输出如下:
注意到这些点未对齐。我怎样才能让它们对齐?