在 LaTeX 中创建表格

在 LaTeX 中创建表格
\begin{table}[H]
%   \begin{landscape}
    \begin{center}
        \caption{Specifications of LTE}
        \label{tab:table1}
        %\begin{adjustbox}{max width=\textwidth}
        \resizebox{\textwidth}{!}{
            \begin{tabular}{ | l |l |p{5cm} |} 
                \hline
                Feature & Details\\
                \hline
                Latency& lessthan 10ms from user to server   \\ \hline
                Mobility& Up to 35km/hr,optmized for 15km/s\\ \hline
                Coverage& Full up to 5km,sight degradation 5-15 operating up to 100km\\
                Channel Bandwidth& 1.4,3,5,10,15,20 \\  \hline
                Mdulation Schemes&UL:QPSK,16QAM,64QAM{{optional} DL:QPSK,16QAM,64QAM\\
                    \hline
                    Multiple Access Scheme&DL:OFDM UL:SC-FDMA   \\ \hline
                    Modes& TDD and FDD   \\ \hline
                    Multi-Antenna Technology& MIMO, DL:1*2,2*2,4*2,4*4   \\ \hline
                    Peak Date Rate& With 20MHZ slot and 4*4 MIMO peakdownlink 300Mbps,Uplink 75Mbps  \\ \hline

            \end{tabular} }
            %\end{adjustbox} 
        \end{center}
    \end{table} 

编译后,出现此错误

File ended while scanning use of \Gscale@box@dd.

并且不显示pdf输出。

答案1

布伦达,因此有一个不成对的括号64QAM{{optional},为了防止在编译文档时出现错误,请将其改为 64QAM{{optional}}OR 64QAM{optional},但是,我怀疑您打算将“可选”放在标准括号内,如下所示:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{table}[h]
%   \begin{landscape}
    \begin{center}
        \caption{Specifications of LTE}
        \label{tab:table1}
        %\begin{adjustbox}{max width=\textwidth}
        \resizebox{\textwidth}{!}{
            \begin{tabular}{ | l |l |p{5cm} |} 
                \hline
                Feature & Details\\
                \hline
                Latency& lessthan 10ms from user to server   \\ \hline
                Mobility& Up to 35km/hr,optmized for 15km/s\\ \hline
                Coverage& Full up to 5km,sight degradation 5-15 operating up to 100km\\
                Channel Bandwidth& 1.4,3,5,10,15,20 \\  \hline
                Mdulation Schemes&UL:QPSK,16QAM,64QAM({optional}) DL:QPSK,16QAM,64QAM\\
                    \hline
                    Multiple Access Scheme&DL:OFDM UL:SC-FDMA   \\ \hline
                    Modes& TDD and FDD   \\ \hline
                    Multi-Antenna Technology& MIMO, DL:1*2,2*2,4*2,4*4   \\ \hline
                    Peak Date Rate& With 20MHZ slot and 4*4 MIMO peakdownlink 300Mbps,Uplink 75Mbps  \\ \hline

            \end{tabular} }
            %\end{adjustbox} 
        \end{center}
    \end{table} 

\end{document}

输出

答案2

尼古拉斯·汉密尔顿已经解释了您的错误,但我想向您提出一些改进建议。

在我看来,如果没有所有这些规则(特别是垂直规则),您的表格会更清晰。

此外,您应该使用\centering,而不是环境center中的环境table,请参见:我应该对图形和表格使用 center 还是 centering ?

您不需要调整表格大小来适应页面,而是可以选择较小的字体(\small\scriptsize\tiny)和/或使用tabularx

最后,我不知道你的文字是什么意思(所以我没有改变它),但我认为你应该看看siunitx包裹

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand*{\arraystretch}{1.4}
\usepackage{graphicx}
\usepackage{caption}

\begin{document}
    \begin{table}[ht]
        \centering\small
        \caption{Specifications of LTE\label{tab:table1}}
            \begin{tabularx}{\linewidth}{lX} 
                \toprule
                Feature & Details\\
                \midrule
                Latency& Less than 10ms from user to server   \\ 
                Mobility& Up to 35km/hr, optmized for 15km/s\\
                Coverage& Full up to 5km, sight degradation 5-15 operating up to 100km\\
                Channel Bandwidth& 1.4, 3, 5, 10, 15, 20 \\
                Modulation Schemes&\makecell[tl]{UL: QPSK, 16QAM, 64QAM (optional)\\ DL: QPSK, 16QAM, 64QAM}\\
                Multiple Access Scheme&DL: OFDM UL: SC-FDMA   \\
                Modes& TDD and FDD   \\
                Multi-Antenna Technology& MIMO, DL: 1*2, 2*2, 4*2, 4*4   \\ 
                Peak Date Rate& With 20MHZ slot and 4*4 MIMO peakdownlink 300Mbps, Uplink 75Mbps  \\ 
                \bottomrule
        \end{tabularx}
    \end{table} 
\end{document}

在此处输入图片描述

相关内容