[Tex/LaTex] Aligning a table entry to the right

tables

I want to adjust a column of a table, such that the heading is centred, the rest rows are left aligned, which I managed myself (see figure). Now, all rows have an additional attribute (length), which I want to be pushed to the extreme right of each cell. I tried with \hfil, but they are now centred in the space (not right aligned).

How can I do that?

MWE added:

\documentclass{article}

\begin{document}
    \begin{table}
        \begin{tabular}{|c|l|} \hline
            Item & \multicolumn{1}{c|}{Entries \hfil (length)} \\ \hline
            1 & 1, 2, 3, 4, 5, 6, 7 \hfil (7) \\ \hline
            2 & 1, 2, 3, 4, 5, 6, 7, 8, 9 \hfil (9) \\ \hline
            3 & 1, 2, 3, 4 \hfil (4) \\ \hline
        \end{tabular}
    \end{table}
\end{document}

Best Answer

Why don't you use 3 columns? Also, you might use the booktabs package: no vertical rules and better vertical spacing between rows. I give an example of both:

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}
    \begin{tabular}[b]{|c|lc|} \hline
        Item & \multicolumn{1}{c}{Entries} & (length) \\ \hline
        1 & 1, 2, 3, 4, 5, 6, 7 & (7) \\ \hline
        2 & 1, 2, 3, 4, 5, 6, 7, 8, 9 & (9) \\ \hline
        3 & 1, 2, 3, 4 & (4) \\ \hline
    \end{tabular}
\end{table}
\mbox{}%\vskip1cm%
\begin{table}[! h]
    \begin{tabular}[b]{@{}clc@{}}
        Item & \multicolumn{1}{c}{Entries} & (length) \\\addlinespace[0.5ex] \toprule
        1 & 1, 2, 3, 4, 5, 6, 7 & (7) \\ \addlinespace
        2 & 1, 2, 3, 4, 5, 6, 7, 8, 9 & (9) \\ \addlinespace
        3 & 1, 2, 3, 4 & (4) \\ \bottomrule
    \end{tabular}
\end{table}

\end{document} 

enter image description here