# Why my longtable is throwing Underfull \vbox (badness 10000)

\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}

# 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

\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:

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

• If I add \end{document} (;-)) and compile this, I get the line warning at 21, so whatever you do, it's different if the warning occurs for line 190 ... – user31729 Aug 22 '17 at 17:30
• Without showing at least line 190, whaht can you hope for? – Bernard Aug 22 '17 at 17:30
• I am saying to you on the question, The line 190 is \end{longtable}. I commented out everything on the file and created the presented example on the question starting at line 170, therefore the example has 20 lines, so 170 + 20 = 190, which is the line where \end{longtable} is on – user Aug 22 '17 at 17:43
• it would have been better ti show the warning as generated from the posted code (with line 21) But no harm done... – David Carlisle Aug 22 '17 at 19:54
• Sorry for it. As tt seemed confusing, for the future I will keep in mind to run the code from files starting on the first line. – user Aug 23 '17 at 1:00

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:

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
\multicolumn{2}{c}{\tablename~\thetable}: Formatação do texto (continued)\\
\hline