无法正确修复表格,同时指定大小会引发错误

无法正确修复表格,同时指定大小会引发错误
\documentclass{article}
\usepackage{array}
\usepackage{rotating}
\begin{document}
\begin{sidewaystable}[htbp]
    \centering
    \caption{Add caption}
    \begin{tabular}{llllll}
        \textbf{Author} & \textbf{Mechanism} & \textbf{Features} & \multicolumn{1}{l}{\textbf{Protocol}} & \textbf{Attacks} & \multicolumn{1}{l}{\textbf{Limitations}} \\
        R. Molva et al., & Across domains & Mutual \& one way authentication & \multicolumn{1}{l}{Stateless Authentication} & Eavedroppers & \multicolumn{1}{l}{GSM} \\
        Hung-Yu et al., & Subscriber identity & Mutual authentication Non repudiation & \multicolumn{1}{l}{Public key} & Subscriber ID Compromised session key & \multicolumn{1}{l}{GSM} \\
        Muxiang Zhang & Fresh key & Mutual authentication \& eliminate synchronisation & \multicolumn{1}{l}{AP-AKA symetric key} & Redirection attack & \multicolumn{1}{l}{3GPP} \\
    \end{tabular}%
    \label{tab:addlabel}%
\end{sidewaystable}%
\end{document}

答案1

我怀疑您正在寻找类似下表的内容:

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs, tabularx}% new
\newcolumntype{L}{>{\raggedright\arraybackslash}X}% new
\usepackage{rotating}

\usepackage{showframe}% only for show page layout
\renewcommand*\ShowFrameColor{\color{red}}

\begin{document}
\begin{sidewaystable}[htbp]
\setlength\tabcolsep{4pt}
    \centering
    \caption{Add caption}
    \begin{tabularx}{\textheight}{l % table width is equal text height
                                  >{\hsize=0.8\hsize}L% new column type
                                  >{\hsize=1.2\hsize}L
                                  >{\hsize=1.2\hsize}L
                                  >{\hsize=0.8\hsize}L
                                  l}
    \toprule % added rules
\textbf{Author}  & \textbf{Mechanism} & \textbf{Features} & \textbf{Protocol}   & \textbf{Attacks} & \textbf{Limitations} \\
    \midrule
R. Molva et al., & Across domains     & Mutual \& one way authentication 
                                                           & Stateless Authentication 
                                                                                & Eavesdroppers    & GSM \\
    \addlinespace
Hung-Yu et al.,  & Subscriber identity& Mutual authentication Non repudiation 
                                                           & Public key         & Subscriber ID Compromised session key 
                                                                                                   & GSM \\
    \addlinespace
Muxiang Zhang    & Fresh key          & Mutual authentication \& eliminate synchronisation & AP-AKA symetric key & Redirection attack & 3GPP \\
    \bottomrule
    \end{tabularx}%
    \label{tab:addlabel}%
\end{sidewaystable}%
\end{document}

相关内容