[Tex/LaTex] Why the longtable is throwing Underfull \vbox (badness 10000)

badnesslongtable

\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage{lmodern}

\usepackage{ragged2e}
\usepackage{longtable}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[main=english]{babel}
\usepackage[showframe,pass]{geometry}

\begin{document}

\begin{longtable}{ | >{\RaggedRight}p{3cm} | >{\RaggedRight}p{5.0cm} | }

        \hline
        Cor                          & Branco \\
        \hline

\end{longtable} \end{document}

The log is:

Underfull \vbox (badness 10000) detected at line 190
 []

The line 190 is \end{longtable}

enter image description here


Update

I took this other example from How to make a table on more than one page by using the table environment

\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage{lmodern}

\usepackage{ragged2e}
\usepackage{ltablex}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[main=english]{babel}
\usepackage[showframe,pass]{geometry}

\begin{document}

\label{tab:daypack}
\begin{tabularx}{\linewidth}{|@{}|cX@{}|}
\caption{Example of an table}\\
\toprule
\textbf{Column 1} & \textbf{Column 2} \\[6pt]
\midrule
\endhead

\hline
$R$ & This is an example sentence \\

\bottomrule
\end{tabularx}

\end{document}

And it is also having the same warning on line 196, but if I comment the \hline the warning stops:

enter image description here

Underfull \vbox (badness 10000) detected at line 196
 []

Best Answer

The warning is being throw because there is a \hline directly after the table header. This should not do the warning anymore:

\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage{lmodern}

\usepackage{ragged2e}
\usepackage{longtable}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[main=english]{babel}
\usepackage[showframe,pass]{geometry}

\begin{document}

\begin{longtable}{ | >{\RaggedRight}p{3cm} | >{\RaggedRight}p{5.0cm} | }

        % \hline % <====== This is the line causing the warning
        Cor                          & Branco \\
        \hline

\end{longtable} \end{document}

However this does not fix the problem of having correctly a line placed at the top of the table:

enter image description here

But the table presented by @Bernard on the question How to auto adjust my last table column width, and why is there Underfull \vbox badness on this table? is correctlly being rendered with no warning at all:

\documentclass[
10pt,
a5paper,
twoside
]{memoir}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{ragged2e}
\usepackage{ltablex}
\keepXColumns
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}
\frenchspacing
\setlength\extrarowheight{2pt}
\begin{tabularx}{\linewidth}{|>{\RaggedRight}p{3cm}|>{\arraybackslash}X|}
    \caption{Formatação do texto}
    \label{tab:table} \\
    \hline
\endfirsthead
\multicolumn{2}{c}{\tablename~\thetable}: Formatação do texto (continued)\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\footnotesize to be continued}
\endfoot
\hline
\endlastfoot
    Tamanho da fonte & 10,5 para o texto incluindo os títulos das seções e subseções.
                       As citações com mais de três linhas as legendas das ilustrações
                       e tabelas, fonte 9,5.
\end{tabularx}

\end{document} 

enter image description here