调整表格底部线条的大小

调整表格底部线条的大小

我怎样才能使底线的尺寸与上两条线的尺寸相同?

\begin{landscape}
\begin{table}[]
    \centering

    \begin{tabular}{llll}

        \toprule
        \textbf{Criterion}                                                                 & \textbf{Active tags}                                                                      & \textbf{Passive tags}      & \textbf{Semi-passive tags}                                                                         \\ \midrule
        \textbf{Power source}                                                              & Built in reader                                                                    & Provided by the reader          & Battery on tag for chip operations 
        \\
        \textbf{Availability}                                                              & Continuous                                                            & Within the field of the reader         & Within the field of the reader                                                                                      \\
        \textbf{\begin{tabular}[c]{@{}l@{}}Signal strength\\ (Reader to tag)\end{tabular}} & Very low                                                                                      & Very high     &Low                                                                                                 \\
        \textbf{\begin{tabular}[c]{@{}l@{}}Signal strength\\ (Tag to Reader)\end{tabular}} & High                                                                                       & Very low &Low                                                                                                     \\
        \textbf{Operating range}                                                           & \textgreater100m                                                                               & \textless7m        & \textless10m                                                                                  \\
        \textbf{Price}                                                                     & 10--50 \$US                                                                                 & 0.05 US\$    & 10--50 \$US                                                                                           \\
        \textbf {Communication Principle}                                                                     &   \begin{tabular}[c]{@{}l@{}}Neither backscatter nor indu- \\ ctive coupling.
            Tag generates \\ electromagnetic waves on \\
            their own.

        \end{tabular}
        &
        \begin{tabular}[c]{@{}l@{}}Either inductive coupling or \\ backscatter  (Near or Far Field)\end{tabular} &
        \begin{tabular}[c]{@{}l@{}}Backscatter \\ (Far Field)\end{tabular}

    \end{tabular}
    \bottomrule
    \caption{Comparison of active and passive tags \cite{RFIDTables}.}
    \label{ref:table2}
\end{table}
\end{landscape}

答案1

无关:

在此处输入图片描述

(红线表示文字边框)

如果您借助tabularxrotating和包使您的表格代码makecellsiunitx简单、更简短,那么出错的可能性就会更小:

\documentclass{article}
\usepackage{rotating}
\usepackage{booktabs, makecell, tabularx}
\setcellgapes{2pt}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}

\begin{document}
    \begin{sidewaystable}
\makegapedcells
    \centering
    \small
    \setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{}
                            >{\bfseries}l L L l
                            @{}}
    \toprule
Criterion
    & \textbf{Active tags}
    & \textbf{Passive tags}
    & \textbf{Semi-passive tags}            \\
    \midrule
Power source
    & Built in reader                                                                    & Provided by the reader
    & Battery on tag for chip operations    \\
Availability
    & Continuous                                                            & Within the field of the reader
    & Within the field of the reader        \\
Signal strength (Reader to tag)  
    & Very low
    & Very high
    & Low                                   \\
Signal strength (Tag to Reader)
    & High
    & Very low
    & Low                                   \\
Operating range
    & \SI{>100}{m}
    & \SI{<7}{m}%   
    & \SI{<10}{m}                           \\
Price 
    & 10--50 \$US
    & 0.05 US\$
    & 10--50 \$US                           \\
Communication Principle                                                                     
    & Neither backscatter nor inductive coupling. Tag generates electromagnetic waves on their own.
    & Either inductive coupling or backscatter (Near or Far Field)
    & Backscatter (Far Field)               \\ % here was error
    \bottomrule
\end{tabularx}   
\caption{Comparison of active and passive tags \cite{RFIDTables}.}
\label{ref:table2}
    \end{sidewaystable}
\end{document}

答案2

您的代码无法编译,因为外部tabular环境缺少最终行终止符(\\),并且指令\bottomrule发生在最终环境之后而不是之前\end{tabular}

我建议您从 a 环境切换tabular到 atabularx环境,并将其整体宽度设置为\textwidth。然后,X对三个数据列使用(修改后的)列,以便根据需要自动换行。此更改将使您无需通过内部环境提供大量明确的换行指令tabular

在此处输入图片描述

\documentclass{article}
% Choose page size parameters suitably:
\usepackage[margin=1in,letterpaper]{geometry} 
\usepackage[english]{babel} % optional (better hyphenations)
\usepackage{booktabs,rotating,siunitx,tabularx,ragged2e}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\begin{document}
\begin{sidewaystable}
\begin{tabularx}{\textwidth}{@{} >{\bfseries}l YYY @{}}
    \toprule
    Criterion 
         & \textbf{Active tags} 
         & \textbf{Passive tags}
         & \textbf{Semi-passive tags} \\
    \midrule
    Power source
         & Built in reader
         & Provided by the reader 
         & Battery on tag for chip operations \\
    \addlinespace
    Availability
         & Continuous
         & Within the field of the reader 
         & Within the field of the reader \\
    \addlinespace
    Signal strength (Reader to tag)
         & Very low & Very high & Low \\
    \addlinespace
    Signal strength (Tag to reader)
         & High & Very low & Low \\
    \addlinespace
    Operating range
         & $>\SI{100}{\meter}$
         & $<\SI{7}{\meter}$ 
         & $<\SI{10}{\meter}$ \\
    \addlinespace
    Price& 10--50 \$US & 0.05 \$US & 10--50 \$US \\
    \addlinespace
    Communication principle
         & Neither backscatter nor inductive coupling. Tags generate electromagnetic 
         waves on their own
         & Either inductive coupling or backscatter (Near or Far Field)
         & Backscatter (Far Field) \\
    \bottomrule
\end{tabularx}
\caption{Comparison of active and passive tags \cite{RFIDTables}.}
\label{ref:table2}
\end{sidewaystable}
\end{document} 

相关内容