浮动表格错位,表格超出页面宽度

浮动表格错位,表格超出页面宽度

我正在使用 IEEEtran 模板。我试图构建一个单列表格,因为第二列中的文本很宽。我使用 table* 制作浮动表格,但第二列中的文本总是错位并超出页面限制。我也尝试使用 tabularx。之后,第二列中的文本在页面限制之内,但表格的两列之间没有分隔。

下面是代码

\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{amsfonts}

\usepackage{booktabs,tabularx}


\usepackage{amsthm}
\usepackage{lipsum}

\usepackage{dblfloatfix}


\begin{document}
\title{A Review}

begin{table*}[t]
\renewcommand{\arraystretch}{1.3}
\caption{Summary of the 6G features and applications.}
\label{table_example}
\centering
\begin{tabular}

\toprule

6G Feature & Description\\
\hline
Tiny Cells & Works well with higher mmWave and THz frequencies. They are simple to install and configure, with the ability of restricting access to a specific set of users present at home or in an office environment.\\
\hline
\bottomrule
\end{tabular}
\end{table*}

\end{document}

答案1

除了实际为环境提供列规范之外tabular,您还需要更改begin{table*}[t]\begin{table*}[t],即提供缺少的反斜杠字符。而且,由于您正在加载包booktabs,我会删除所有杂散\hline指令。

对于手头的表格,第二列的规范应该允许自动换行。一种方法是将其替换tabulartabularx,选择X作为第二列的类型,并设置合适的环境总宽度。对于手头的材料,我会选择介于和tabularx之间的总宽度。0.8\textwidth1\textwidth

在此处输入图片描述

\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{booktabs,tabularx}

\begin{document}

\begin{table*}
%\renewcommand{\arraystretch}{1.3}
\caption{Summary of 6G features and applications.}
\label{table_example}
\centering
\begin{tabularx}{0.8\textwidth}{@{} l X @{}}
\toprule
6G Feature & Description \\
\midrule
Tiny Cells & Works well with higher mmWave and THz frequencies. 
They are simple to install and configure, with the ability of 
restricting access to a specific set of users present at home 
or in an office environment. \\
\bottomrule
\end{tabularx}
\end{table*}

\end{document}

相关内容