如何绘制宽幅横向表格?

如何绘制宽幅横向表格?

我试图用我的列和数据绘制如下图所示的表格,但不知道该怎么做。如能得到任何帮助我将不胜感激。

参考表

\begin{document}    
    \begin{landscape}
    \begin{table}[]
    \caption{Comparison table}
    \label{tab:my-table}
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|}
    \hline
                            & Types of Images            & Transform Domain            & Nature & Number of keys                                                  & Chaotic System   used  & Resistance to   attacks                                    & Key Sensitivity & Entropy & PSNR     & MSE             & Encryption   Time(s) \\ \hline
    Bentham-Hukum           & Lena                       & Gyrator Transform, PTFT?    & -      & -                                                               & -                      & -                                                          & -               & 6.8906  & -        & 2.26 x 10   -22 & 1.35                 \\ \hline
    Optik,   Hukum+ Anshula & -                          & Fractional Hartely,         & -      & -                                                               & -                      & Yes                                                        & -               & -       & 316.12   & 5.70 x 10 -34   & -                    \\ \hline
    Yaoling   Zhou et al.   & Cover Lena image was used. & TVAL3 and wavelet transform & -      & -                                                               & Logistic map           & Yes, agaisnt Brute Force attacks   and Occlusional Attacks & -               &         & 32.00998 & -               & -                    \\ \hline
    Sachin,   Phool Singh   & Boy                        & Chirp Z Transform           & -      & 6 chaos parameters, 3 frequency   parameters and 2 private keys & Chaotic Tinkerbell Map & Yes                                                        & Very large      & 7.9875  & -        & 4.8818 x 10 4   & -                    \\ \hline
    Our Paper               & ABC                        & ABC                         & -      & -                                                               & ABC                    & ABC                                                        & -               & -       & -        & -               & -                    \\ \hline
    \end{tabular}
    \end{table}
    \end{landscape}
\end{document}

答案1

  • 作为起点 simce 必要文件序言为您的表是未知的...
  • 两种解决方法:
    • 通过使用tabularx
\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pdflscape}
\usepackage{ragged2e}
\usepackage{tabularx}
\usepackage{siunitx}

\begin{document}

    \begin{landscape}
\begin{table}[ht]
\sisetup{tight-spacing}
\small
\caption{Comparison table}
\label{tab:my-table}
\setlength\tabcolsep{3pt}
\setlength\extrarowheight{2pt}
\begin{tabularx}{\linewidth}{|*{12}{>{\RaggedRight\hspace{0pt}}X |}}
    \hline
    & Types of Images   & Transform Domain      & Nature 
    & Number of keys    & Chaotic System used   & Resistance to   attacks   
    & Key Sensitivity   & Entropy               & PSNR     
    & MSE               & Encryption   Time(s)          \\ 
    \hline
Bentham-Hukum           
    & Lena              & Gyrator Transform, PTFT?  & - & -
    & -                 & -                     & - & 6.8906  
    & -                 & \num{2.26e-22}        & 1.35      \\ 
    \hline
Optik,   Hukum+ Anshula & -                     & Fractional Hartely,         
    & -                 & -                     & -                      
    & Yes               & -                     & -       
    & 316.12            & \num{5.70e-34}        & -         \\
    \hline
Yaoling   Zhou et al.   & Cover Lena image was used. & TVAL3 and wavelet transform 
    & -                 & -                     & Logistic map           
    & Yes, agaisnt Brute Force attacks   and Occlusional Attacks 
                        & -                     &         
    & 32.00998          & -                     & -         \\ 
    \hline
Sachin,   Phool Singh   & Boy                   & Chirp Z Transform           
    & -                 & 6 chaos parameters, 3 frequency   parameters and 2 private keys 
                                                & Chaotic Tinkerbell Map 
    & Yes               & Very large            & 7.9875  
    & -                 & \num{4.8818e4}       & -         \\ 
    \hline
Our Paper               & ABC                   & ABC                         
    & -                 & -                     & ABC                    
    & ABC               & -                     & -       
    & -                 & -                     & -         \\
    \hline
\end{tabularx}
\end{table}
\end{landscape}
\end{document}

在此处输入图片描述

  • tabularray通过使用包,可以稍微复杂一点
\documentclass{article}
\usepackage[margin=20mm]{geometry}

\usepackage[font=small, labelfont=bf,
            labelsep=quad,
            singlelinecheck=off]
            {caption}
\usepackage{pdflscape}
\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{landscape}
\leavevmode\vfil
\begin{table}[ht]
\sisetup{tight-spacing}
\small
\caption{Comparison table}
\label{tab:my-table}
\begin{tblr}{hlines, vlines,
             colspec = {*{3}{X[1.1, cmd=\RaggedRight\hspace{0pt}]}
                             X[0.8, cmd=\RaggedRight\hspace{0pt}]
                        *{3}{X[1.5, cmd=\RaggedRight\hspace{0pt}]}
                        *{3}{X[0.8, cmd=\RaggedRight\hspace{0pt}]}
                        *{2}{X[cmd=\RaggedRight\hspace{0pt}]}
                        },
             colsep=3pt,
             row{1} = {cmd=\Centering}
             }
    & Types of Images   & Transform Domain      & Nature 
    & Number of keys    & Chaotic System used   & Resistance to   attacks   
    & Key Sensitivity   & Entropy               & PSNR     
    & MSE               & Encryption   Time(s)          \\ 
Bentham-Hukum           
    & Lena              & Gyrator Transform, PTFT?  & - & -
    & -                 & -                     & - & 6.8906  
    & -                 & \num{2.26e-22}        & 1.35      \\ 
Optik,   Hukum+ Anshula & -                     & Fractional Hartely,         
    & -                 & -                     & -                      
    & Yes               & -                     & -       
    & 316.12            & \num{5.70e-34}        & -         \\
Yaoling   Zhou et al.   & Cover Lena image was used. & TVAL3 and wavelet transform 
    & -                 & -                     & Logistic map           
    & Yes, agaisnt Brute Force attacks   and Occlusional Attacks 
                        & -                     &         
    & 32.00998          & -                     & -         \\ 
Sachin,   Phool Singh   & Boy                   & Chirp Z Transform           
    & -                 & 6 chaos parameters, 3 frequency   parameters and 2 private keys 
                                                & Chaotic Tinkerbell Map 
    & Yes               & Very large            & 7.9875  
    & -                 & \num{4.8818e4}       & -         \\ 
Our Paper               & ABC                   & ABC                         
    & -                 & -                     & ABC                    
    & ABC               & -                     & -       
    & -                 & -                     & -         \\
\end{tblr}
\end{table}
\end{landscape}
\end{document}

在此处输入图片描述

答案2

您可以使用双页浮动来显示表格。这只在双页文档中有意义:

\documentclass[twoside]{article}
\usepackage{hvfloat}
\usepackage{blindtext}% only for demo
\usepackage{array,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\begin{document}

\Blindtext[15]

\hvFloat[sameHeight,doublePage,capPos=bottom]{table}{%
  \begin{tabular}{|P{2cm}|P{2cm}|P{3cm}|l|P{3cm}|l|P{3cm}|l|l|l|l|P{2cm}|}
    \hline
    & Types of Images            & Transform Domain            & Nature & Number of keys                                                  & Chaotic System   used  & Resistance to   attacks                                    & Key Sensitivity & Entropy & PSNR     & MSE             & Encryption   Time(s) \\ \hline
    Bentham-Hukum           & Lena                       & Gyrator Transform, PTFT?    & -      & -                                                               & -                      & -                                                          & -               & 6.8906  & -        & 2.26 x 10   -22 & 1.35                 \\ \hline
    Optik,   Hukum+ Anshula & -                          & Fractional Hartely,         & -      & -                                                               & -                      & Yes                                                        & -               & -       & 316.12   & 5.70 x 10 -34   & -                    \\ \hline
    Yaoling   Zhou et al.   & Cover Lena image was used. & TVAL3 and wavelet transform & -      & -                                                               & Logistic map           & Yes, agaisnt Brute Force attacks   and Occlusional Attacks & -               &         & 32.00998 & -               & -                    \\ \hline
    Sachin,   Phool Singh   & Boy                        & Chirp Z Transform           & -      & 6 chaos parameters, 3 frequency   parameters and 2 private keys & Chaotic Tinkerbell Map & Yes                                                        & Very large      & 7.9875  & -        & 4.8818 x 10 4   & -                    \\ \hline
    Our Paper               & ABC                        & ABC                         & -      & -                                                               & ABC                    & ABC                                                        & -               & -       & -        & -               & -                    \\ \hline
  \end{tabular}}
  {Comparison table}%
  {tab:my-table}
  
\Blindtext[15]

See tabular~\ref{tab:my-table}
  
\end{document}

在此处输入图片描述

相关内容