当我想用 LaTeX 准备文档时,我总是收到不同的警告,包括未满和过满,但我不知道如何处理这些警告。正如您在此处看到的,我在 LaTeX 中有两个表格,但我遇到了相同的错误,请帮助我如何更改这些表格以解决这些警告。
\begin{table}[h]
\renewcommand{\arraystretch}{1.3}
\caption{Contention window size updating}
\label{tab:table1}
\centering
\begin{tabularx}{3.7cm}{ll}
\hline
\bfseries Status & \bfseries CW range \\
\hline\hline
011 & \\
101 & ${CW}_{min}$\\
111 & \\
\hline
\end{tabularx}
\end{table}
\begin{table}[h]
\renewcommand{\arraystretch}{1}
\caption{The simulation parameters}
\label{tab:table2}
\centering
\begin{tabularx}{7cm}{ll}
\hline
\bfseries Simulation Parameter & \bfseries Value \\
\hline\hline
Traffic type & CBR\\
CBR packet size & 512 byte\\
CBR data rate & 4 packet/s\\
Transport protocol & UDP\\
\end{tabularx}
\end{table}
答案1
为什么使用tabularx
无X
列?简单的\begin{tabular}{ll}
就足够了:
\documentclass{article}
\begin{document}
\begin{table}
\renewcommand{\arraystretch}{1.3}
\caption{Contention window size updating}
\label{tab:table1}
\centering
\begin{tabular}{ll}
\hline
\bfseries Status & \bfseries CW range \\
\hline\hline
011 & \\
101 & ${CW}_{min}$\\
111 & \\
\hline
\end{tabular}
\end{table}
\begin{table}
\renewcommand{\arraystretch}{1}
\caption{The simulation parameters}
\label{tab:table2}
\centering
\begin{tabular}{ll}
\hline
\bfseries Simulation Parameter & \bfseries Value \\
\hline\hline
Traffic type & CBR\\
CBR packet size & 512 byte\\
CBR data rate & 4 packet/s\\
Transport protocol & UDP\\
\end{tabular}
\end{table}
\end{document}