更新

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

日志为:

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

190 号线是\end{longtable}

在此处输入图片描述


更新

我从中引用了另一个例子如何使用表格环境在多个页面上创建表格

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

并且在第 196 行也出现了同样的警告,但如果我注释掉,警告\hline就会停止:

在此处输入图片描述

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

答案1

出现警告是因为\hline表头后面直接有一个。这样就不会再出现警告了:

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

但是,这并不能解决表格顶部正确放置一行的问题:

在此处输入图片描述

但表格中@Bernard关于如何自动调整我最后一个表格的列宽,以及为什么这个表格上有 Underfull \vbox 问题?正确呈现,没有任何警告:

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

在此处输入图片描述

相关内容