我实现的效果如下:
重点解决两个问题:
1.宽度不能超过左侧栏宽度影响到右边;2.中间列要居中
解决方法是限制中间栏的宽度(这一列字最多,如果不限制就会写在一行变得特别长),使用的代码如下,第一个c代表第一列居中,第二个p给出第二列长度为4.5cm,p前面加入的语句代表居中,第三个c代表第三列居中,注意要在文章最前面导入array包\usepackage{array}
\begin{tabular}{c>{\centering\arraybackslash}p{4.5cm}c}
整个表格的latex代码如下:
\begin{table} % 表格开始
\centering % 表格居中显示
\caption{Simulation parameters} % 表头标题
\label{table_example} % 表格标签,便于引用
\begin{tabular}{c>{\centering\arraybackslash}p{4.5cm}c} % 定义三列表格
% \begin{tabular}{p{2cm}cp{2cm}}
\toprule
Parameters & Symbol & Value \\ % 表头需要三个单元格,并用\\结束
\midrule
$v_{max}$ & the maximum UAV flight speed & $ 50 $ m/s \\ % 每一行结束都需要\\
$M_{UAV}$ & gross mass of UAV & 9.65kg \\ % 使用\times和^{}来输入乘法和上标
$f_n$ & The computing capability of the UV & 0.5GHz \\
$f_{UAV}$ & The computing capability of the UV & 4GHz \\
$f_{SAT}$ & The computing capability of the LEO satellite & 6GHz \\
$f_{BS}$ & The computing capability of the UV & 4GHz \\
$s$ & the required CPU cycles per bit & 1000 cycles/bit \\
$P$ & transmission power of UV & 0.1W \\
$PLoss$ & penetration loss & -20dBm \\
$t_p$ & propagation delay & 10ms \\
$\theta^2$ & noise variance & -100dBm \\
$B$ & transmission bandwidth & 1MHz \\
$h_0^v$ & channel power gain at a reference distance of 1 m & $-50dB$ \\
$H$ & UAV flying fixed height & 50m \\
$K$ & max episodes & 2000 \\
$T$ & time slots number & 40 \\
$\delta_t$ & slot time & 5s \\
$t_{fly}$ & flight time & 1s \\
\bottomrule
\end{tabular}
\end{table}