嘿,我有一个奇怪的问题,我有下表
\begin{table}[h]
\centering
\begin{tabular*}{\textwidth}{|l|l|l|l|l|l|}
\hline
\rowcolor{lightgray}
\textbf{\gls{rlnc} Code} & \textbf{Finite Field} & \textbf{Generation Size} & \textbf{Symbol Size} & \textbf{Data Size} & \textbf{Expected Result} \\ \hline
Full Vector Code & $F^{8}$ & 1 & 8 & 100(Mb) & 300 Mb/S\\ \hline
\end{tabular*}
\caption{Hypothesised experiment results for throughput, in relation to \gls{rlnc} code, generation size, data size (Kb, Mb, Gb), and symbol size in bytes.}
\label{tab:hyp-expect}
\end{table}
当我编译我的文档时,它看起来像这样:
我怎样才能使行断开?因为我以为\textwidth
会为我做到这一点。
答案1
l
、、c
列类型r
不会换行。您必须使用p{width}
(或m
或b
)来实现换行,但您必须计算宽度。
最简单的方法是使用tabularx
,它会为您计算列的宽度。您可以尝试以下代码:
\begin{table}[h]
\centering
\begin{tabularx}{\textwidth}{|*{6}{X|}}
\hline
\rowcolor{lightgray}
\textbf{\gls{rlnc} Code} & \textbf{Finite Field} & \textbf{Generation Size} & \textbf{Symbol Size} & \textbf{Data Size} & \textbf{Expected Result} \\ \hline
Full Vector Code & $F^{8}$ & 1 & 8 & 100(Mb) & 300 Mb/S\\ \hline
\end{tabularx}
\caption{Hypothesised experiment results for throughput, in relation to \gls{rlnc} code, generation size, data size (Kb, Mb, Gb), and symbol size in bytes.}
\label{tab:hyp-expect}
\end{table}