如何使表格单元格的值在乳胶中居中?
请告诉我如何使该表中的值出现在中间。
\begin{table}[h]
\begin{center}
\caption{Mobile IP throughput statistics}
\begin{tabular}{ | p{2.5cm} | p{2.5cm} | p{2.5cm} | }
\hline Speed (km/hr) & Max (packets/sec) & Sample mean (packets/sec) \\
\hline 20 & 261.67 & 209.05\\
\hline 70 & 262.5 & 207.91\\
\hline 80 & 259.58 & 209.03\\
\hline 90 & 260.75 & 209.47\\
\hline 100 & 260.33 & 209.3 \\
\hline 120 & 262.42 & 210.4 \\
\hline 160 & 259.08 & 210.29\\
\hline
\end{tabular}
\label{table:table3}
\end{center}
\end{table}
Please tell me how to make the values in this table to appear in the centre.
\begin{table}[h]
\begin{center}
\caption{Mobile IP throughput statistics}
\begin{tabular}{ | p{2.5cm} | p{2.5cm} | p{2.5cm} | }
\hline Speed (km/hr) & Max (packets/sec) & Sample mean (packets/sec) \\
\hline 20 & 261.67 & 209.05\\
\hline 70 & 262.5 & 207.91\\
\hline 80 & 259.58 & 209.03\\
\hline 90 & 260.75 & 209.47\\
\hline 100 & 260.33 & 209.3 \\
\hline 120 & 262.42 & 210.4 \\
\hline 160 & 259.08 & 210.29\\
\hline
\end{tabular}
\label{table:table3}
\end{center}
\end{table}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一种方法。但这可能不是“正确”的方式:
Here's one way. But it's probably not the "correct" way:
要让它更短一些,您还可以执行以下操作:
将
\usepackage{array}
放入您的头部,然后在\begin{tabular}
表达式中编写以下:不过,现在您必须使用
\tabularnewline
而不是\\
来声明新行。如果列的宽度不重要,您也可以直接使用,无需任何进一步的更改。
To have it a bit shorter, you could also do the following:
Put
\usepackage{array}
in your head, and in your\begin{tabular}
expression, write the following:Now you have to use
\tabularnewline
instead of\\
to declare a new line, though. If the width of your columns isn't important, you could also usewithout any further changes.
tabularray
包可以轻松配置水平对齐方式:The
tabularray
package makes it easy to configure the horizontal alignment: