创建一个很长的表格并将其保持在同一页面上

创建一个很长的表格并将其保持在同一页面上

我正在以下文本下方创建一个长表

文本为“最初,我们将使用所有功能。”

但是当我创建表格时

\begin{table} [h!]

\begin{tabularx}{\textwidth}{@{} l X @{}} 

duration & length (number of seconds) of the connection \\
src_bytes & number of data bytes from source to destination \\
dst_bytes & number of data bytes from destination to source     \\
land & 1 if connection is from/to the same host/port; 0 otherwise \\
wrong_fragment &number of ``wrong'' fragments   \\
urgent & number of urgent packets   \\
hot & number of ``hot'' indicators  \\
num_failed_logins & number of failed login attempts \\
logged_in & 1 if successfully logged in; 0 otherwise \\
num_compromised & number of ``compromised'' conditions  \\
root_shell & 1 if root shell is obtained; 0 otherwise   \\
su_attempted & 1 if ``su root'' command attempted; 0 otherwise  \\
num_root & number of ``root'' accesses  \\
num_file_creations & number of file creation operations     \\
num_shells & number of shell prompts    \\
num_access_files & number of operations on access control files     \\
num_outbound_cmds & number of outbound commands in an ftp session   \\
is_host_login & 1 if the login belongs to the ``hot'' list; 0 otherwise     \\
is_guest_login & 1 if the login is a ``guest''login; 0 otherwise     \\
count & number of connections to the same host as the current connection in the past two seconds    \\
srv_count & number of connections to the same service as the current connection in the past two seconds     \\
serror_rate & \% of connections that have ``SYN'' errors \\
srv_serror_rate & \% of connections that have ``SYN'' errors    \\
rerror_rate & \% of connections that have ``REJ'' errors    \\
same_srv_rate & \\
diff_srv_rate & \\
srv_diff_host_rate & \\
dst_host_count & \\
dst_host_srv_count & \\
dst_host_same_srv_rate & \\
dst_host_diff_srv_rate & \\
dst_host_same_src_port_rate & \\
dst_host_srv_diff_host_rate & \\
dst_host_serror_rate & \\
dst_host_srv_serror_rate & \\
dst_host_rerror_rate & \\
dst_host_srv_rerror_rate & \\

\end{tabularx}
\end{table} 

文本下方所有内容均为空白,下一页生成表格。您可以看到以下屏幕截图 文字后空白
那么我该如何摆脱这种情况呢?在我的情况下,表格内容可能会延伸到下一页甚至更多。我试过了

\begin{longtable} [h!]
\begin{tabularx}{\textwidth}{@{} l X @{}} 

\end{tabularx}
\end{longtable} 

但这也没有帮助。我使用的是部门提供的模板,您可以看到这里

相关内容