\begin{table}[h]
\begin{center}
\renewcommand{\arraystretch}{1.5}
\renewcommand{\tabcolsep}{0.2cm}
\begin{tabular}{|c|c|c|c|}
\hline
**\multirow{3}*{{\bf Ingredients}} & \multicolumn{2}{|p{3cm}|}{{\bf Composition of each kg of feed (gram)}} & \multicolumn{1}{|p{3.5cm}|}{{\bf Minimum monthly requirement per turkey (gram)}}\\\cline{2-3}**
& {\bf Brand 1} & {\bf Brand 2} & \\ \hline
{\bf A} & 5 & 10 & 90 \\
{\bf B} & 4 & 3 & 48 \\
{\bf C} & 18 & 0 & 1 \\
{\bf Cost per kg} & 2c & 3c & \\ \hline
\end{tabular}
\caption{\label{table:one}Turkey Feed}
\end{center}
\end{table}
underfull \hbox (badness 10000) Composition of
underfull \hbox (badness 2103) minimum monthly
underfull \hbox (badness 10000) requirement per
请您帮忙处理这些坏的盒子。
谢谢
答案1
您可以通过从包\RaggedRight
中添加以下内容来消除它们ragged2e
:
笔记:
- 您应该使用
\bfseries
而不是`\bf:我使用 \textit 或 \it、\bfseries 或 \bf 等有关系吗 - 另外使用
\centering
和center
环境:何时应使用 \begin{center} 而不是 \centering?
代码:
\documentclass{article}
\usepackage{multirow}
\usepackage{ragged2e}
\begin{document}
\begin{table}[h]
\centering
\renewcommand{\arraystretch}{1.5}
\renewcommand{\tabcolsep}{0.2cm}
\begin{tabular}{|c|c|c|c|}
\hline
**\multirow{3}*{{\bfseries Ingredients}} & \multicolumn{2}{|p{3cm}|}{\bfseries\RaggedRight Composition of each kg of feed (gram)} & \multicolumn{1}{|p{3.5cm}|}{\bfseries\RaggedRight Minimum monthly requirement per turkey (gram)}\\\cline{2-3}**
& {\bfseries Brand 1} & {\bfseries Brand 2} & \\ \hline
{\bfseries A} & 5 & 10 & 90 \\
{\bfseries B} & 4 & 3 & 48 \\
{\bfseries C} & 18 & 0 & 1 \\
{\bfseries Cost per kg} & 2c & 3c & \\ \hline
\end{tabular}
\caption{\label{table:one}Turkey Feed}
\end{table}
\end{document}