绘制多列表格

绘制多列表格

我正在尝试创建图中的表格。

在此处输入图片描述

这是我的代码:

\begin{table*}[ht]

% \resizebox{\textwidth}{!}{%
% \resizebox{1\textwidth}{!}{%
\resizebox{17.5cm}{6.9cm}{%
\begin{tabular}{|l|l|lllll|l|l|l|}
\hline
\multirow{2}{*}{\rotatebox[origin=c]{90}{\textbf{Paper}}} & \multirow{2}{*}{\textbf{Scope}} & \multicolumn{5}{c|}{\textbf{Topics}}                                                                                                                               & \multicolumn{1}{c|}{\multirow{2}{*}{\textbf{Contribution}}} & \multirow{2}{*}{\textbf{Drawbacks}} & \multirow{2}{*}{\rotatebox[origin=c]{90}{\textbf{Year}}} \\ \cline{3-7}
                                &                                 &  \multicolumn{1}{l|}{\rotatebox[origin=c]{90}{Architecture Design}} & \multicolumn{1}{l|}{\rotatebox[origin=c]{90}{Mobility}} & \multicolumn{1}{l|}{\rotatebox[origin=c]{90}{Security}} & \multicolumn{1}{l|}{\rotatebox[origin=c]{90}{Privacy}} & {\rotatebox[origin=c]{90}{Detection and Prevention}} & \multicolumn{1}{c|}{}                                       &                                       &                                \\ \hline
              \textit{\rotatebox[origin=c]{90}{\textbf{\cite{139}}} }            & \textbullet VFC environment                                & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{55}}        &  \multicolumn{1}{l|}{\ding{55}}        & \begin{tabular}[c]{@{}l@{}}\textbullet VFC architecture \\ \textbullet Security issues in VFC \end{tabular}                                                                                    &    \begin{tabular}[c]{@{}l@{}}\textbullet Security solutions  in VFC\end{tabular}                                   & \rotatebox[origin=c]{90}{2019}                           \\ \hline
\textit{\rotatebox[origin=c]{90}{\textbf{\cite{142}} }}                          &  \textbullet VEC environment                               & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{55}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}        &    \multicolumn{1}{l|}{\ding{55}}                      & \begin{tabular}[c]{@{}l@{}}\textbullet V2V and V2I in VEC \\ \textbullet Security and privacy in VEC \end{tabular}   
          &    \begin{tabular}[c]{@{}l@{}}\textbullet VFC and VEC comparison \\ \textbullet VEC security requirements \end{tabular}                                     & \rotatebox[origin=c]{90}{2019}                           \\ \hline
\textit{\rotatebox[origin=c]{90}{\textbf{\cite{143}} } }                           & \textbullet FC in VANET                                & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{55}}        &   \multicolumn{1}{l|}{\ding{55}}                        & \begin{tabular}[c]{@{}l@{}}\textbullet Connecting vehicles to VANET\\ \textbullet Security and forensics \\ requirements  \end{tabular}                                                             &   \begin{tabular}[c]{@{}l@{}}\textbullet Vehicles as Fog nodes \\ \textbullet Possible scenarios in VFC \\ \textbullet Detection and prevention in VFC  \end{tabular}                                    & \rotatebox[origin=c]{90}{2017}                           \\ \hline

\textit{\rotatebox[origin=c]{90}{\textbf{\cite{146}} }}                &    \textbullet VFC application                             & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{55}}         & \multicolumn{1}{l|}{\ding{55}}        &     \multicolumn{1}{l|}{\ding{55}}                      & \begin{tabular}[c]{@{}l@{}}\textbullet VFC : Video crowd-sourcing  \\ as a study case     \end{tabular}                                                              &  \begin{tabular}[c]{@{}l@{}}\textbullet Security and privacy challenges \\ \textbullet Countermeasures for mitigation \\  in VFC  \end{tabular}                                     & \rotatebox[origin=c]{90}{2018}                           \\ \hline

\textit{\rotatebox[origin=c]{90}{\textbf{\cite{149}} }}                 &    \textbullet FC in VANET                            & \multicolumn{1}{l|}{\ding{55}}                    & \multicolumn{1}{l|}{\ding{55}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}        &   \multicolumn{1}{l|}{\ding{55}}                        & \begin{tabular}[c]{@{}l@{}}\textbullet Integration of FC in VANET     \end{tabular}                                                             &   \begin{tabular}[c]{@{}l@{}}\textbullet Deployment on vehicles as \\ fog nodes \\  \textbullet VFC applications     \end{tabular}                                     & \rotatebox[origin=c]{90}{2017}                           \\ \hline

\textit{\rotatebox[origin=c]{90}{\textbf{\cite{145}}} }               &       \textbullet 
 VFC challenges                            & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}        &   \multicolumn{1}{l|}{\ding{55}}                       & \begin{tabular}[c]{@{}l@{}}\textbullet VFC taxonomy \\ vehicles deployment in VFC     \end{tabular}                                                            &   \begin{tabular}[c]{@{}l@{}}\textbullet VFC implementation requirements \\ \textbullet Detection and \\prevention  in VFC  \end{tabular}                                     & \rotatebox[origin=c]{90}{2020}                           \\ \hline

\textit{\rotatebox[origin=c]{90}{\textbf{\cite{147}} } }                 &  \makecell{\textbullet Dissemination of \\ Data in VFC}                         & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{55}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{55}}        &  \multicolumn{1}{l|}{\ding{55}}                         & \begin{tabular}[c]{@{}l@{}} VCC vs VFC in: \\ \textbullet Data Dissemination \\ \textbullet Applications \\ \textbullet Security threats   \end{tabular}                                                              &   \begin{tabular}[c]{@{}l@{}}\textbullet Privacy issues in VFC \\ \textbullet Misbehaving detection and\\ prevention  solutions   \end{tabular}                                     & \rotatebox[origin=c]{90}{2021}                           \\ \hline

\textit{\rotatebox[origin=c]{90}{\textbf{Our \\ \textbf{survey} } }}              &   \textbullet VFC                              & \multicolumn{1}{l|}{\ding{51}}                    & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}         & \multicolumn{1}{l|}{\ding{51}}        &  \multicolumn{1}{l|}{\ding{51}}                         &  \begin{tabular}[c]{@{}l@{}}\textbullet VFC global architecture  \\ \textbullet VFC implementation \\ \textbullet VFC  scenarios \\ \textbullet Security and privacy threats \\ \textbullet Detection and prevention  in VFC   \end{tabular}                                                            &                                       &                            \\ \hline
\end{tabular}
}
\caption{Related Surveys Comparison}
\label{tab: RelatedSurveys}
\end{table*}

答案1

以下解决方案使用tabularx环境,并对 10 列中的 2 列使用X列类型。它还对 2 个 X 类型列中的项目使用定制的 itemize 类环境。请注意,我删除了几乎所有\multicolumn{1}{l|}{...}包装器,因为它们除了造成相当大的代码混乱之外什么也不做。

在此处输入图片描述

\documentclass[twocolumn]{article} % or some other suitable document class
\usepackage{rotating,multirow,makecell,tabularx,pifont}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters as needed
\newcommand\rx[1]{\rotatebox[origin=c]{90}{#1}} % handy shortcut macro
\usepackage{enumitem,ragged2e}
%% create a bespoke itemize-like environment:
\newlist{myitemize}{itemize}{1}
\setlist[myitemize,1]{nosep, label=\textbullet, left=0pt,
          before={\strut\RaggedRight\begin{minipage}[t]{\hsize}},
          after =\end{minipage}}

\begin{document}

\begin{table*}
\setlength\tabcolsep{3pt}
\begin{tabularx}{\textwidth}{| *{7}{l|} X | X | l |}
\hline

\multirow{2.5}{*}{\rx{Paper}} & 
Scope & 
\multicolumn{5}{c|}{Topics} & 
Contribution & 
Drawbacks & 
\multirow{2}{*}{\rx{Year}} \\ 
\cline{3-7}
 &  &  
\rx{Architect.\ Design} & 
\rx{Mobility} & 
\rx{Security} & 
\rx{Privacy} & 
\rx{~Detect.\ and Prev.~} & & & \\ 
\hline
\rx{\cite{139}} & 
VFC env. & 
\ding{51} & \ding{51} & \ding{51} & \ding{55} & \ding{55} & 
\begin{myitemize}
  \item VFC architecture  
  \item Security issues in VFC 
\end{myitemize}   &    
\begin{myitemize}
  \item Security solutions in VFC
\end{myitemize} & 
\multirow{2}{*}{\rx{2019}} \\ 
\hline
\rx{\cite{142}}  &  
VEC env. & 
\ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{55} & 
\begin{myitemize}
  \item V2V and V2I in VEC 
  \item Security and privacy in VEC 
\end{myitemize}  &    
\begin{myitemize}
  \item VFC and VEC comparison 
  \item VEC security requirements 
\end{myitemize} & 
\multirow{2}{*}{\rx{2019}} \\ 
\hline
\rx{\cite{143}} & 
FC in VANET & 
\ding{51} & \ding{51} & \ding{51} & \ding{55} & \ding{55} & 
\begin{myitemize}
  \item Connecting vehicles to VANET
  \item Security and forensics requirements  
\end{myitemize} &   
\begin{myitemize}
  \item Vehicles as Fog nodes 
  \item Possible scenarios in VFC 
  \item Detection and prevention in VFC  
\end{myitemize} & 
\multirow{3}{*}{\rx{2017}} \\ 
\hline
\rx{\cite{146}}  &    
VFC application  & 
\ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & 
\begin{myitemize}
  \item VFC : Video crowd-sourcing 
  as a study case     
\end{myitemize} &  
\begin{myitemize}
  \item Security and privacy challenges 
  \item Countermeasures for mitigation in VFC  
\end{myitemize} & 
\multirow{2}{*}{\rx{2018}} \\ 
\hline
\rx{\cite{149}} &    
FC in VANET & 
\ding{55} & \ding{55} & \ding{51} & \ding{51} & \ding{55} & 
\begin{myitemize}
  \item Integration of FC in VANET 
\end{myitemize}   &   
\begin{myitemize}
  \item Deployment on vehicles as fog nodes 
  \item VFC applications     
\end{myitemize} & 
\multirow{2}{*}{\rx{2017}} \\ 
\hline
\rx{\cite{145}}  &       
VFC challenges & 
\ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{55} & 
\begin{myitemize}
  \item VFC taxonomy vehicles deployment in VFC     
\end{myitemize}  &   
\begin{myitemize}
  \item VFC implementation requirements 
  \item Detection and prevention in VFC  
\end{myitemize}  & 
\multirow{2}{*}{\rx{2020}} \\ 
\hline
\rx{\cite{147}}   &  
\makecell[t]{Dissemination of \\ Data in VFC} & 
\ding{51} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & 
  VCC vs VFC in: 
  
  \begin{myitemize} 
  \item Data Dissemination 
  \item Applications 
  \item Security threats   
\end{myitemize} &   
\begin{myitemize}
  \item Privacy issues in VFC 
  \item Misbehaving detection and prevention solutions   
\end{myitemize} & 
\multirow{2}{*}{\rx{2021}} \\ 
\hline
\multirow{5}{*}{\rx{Our survey}}  &   
VFC   & 
\ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} &  
\begin{myitemize}
  \item VFC global architecture 
  \item VFC implementation
  \item VFC scenarios 
  \item Security and privacy threats
  \item Detection and prevention in VFC   
\end{myitemize} & & \\ 
\hline
\end{tabularx}

\caption{Related Surveys Comparison}
\label{tab: RelatedSurveys}
\end{table*}
\end{document}

答案2

使用tabularray\rotatingmakecell(最后两个用于旋转单元格内容)和enumitem包。为了更好地填充单元格,可以减小\linespread表格单元格中的字体大小和。使用它们可以改善表格外观,简化表格主体代码,但是这需要更长的编译时间,并且表格前言也更复杂一些:

\documentclass[twocolumn]{article} 
\usepackage[a4paper,margin=2.5cm]{geometry} 
\usepackage{pifont}

\usepackage{rotating,
            makecell}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}

\usepackage{ragged2e}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{itemize}{\RaggedRight}

\begin{document}
    \begin{table*}
    \setlist[itemize]{nosep,
                      itemsep=0.5ex,
                      leftmargin=*}
    \small\linespread{0.84}\selectfont,
    \renewcommand\theadfont{\small}

\begin{tblr}{hlines, vlines,
             colspec = {Q[c, m]
                        X[0.6, c, m]
                        *{5}{Q[c, wd=2em]}
                        *{2}{X[c, h]}
                        Q[c]
                        },
             colsep  = 3pt,
             cell{1}{1,Z}   = {r=2}{f,cmd=\renewcommand\theadalign{bl}
                                          \settowidth\rotheadsize{\theadfont Paper}       
                                          \rothead},        % <---
             cell{1}{2,X-Z} = {r=2}{f},                     % <---
             cell{3-Y}{Z} = {cmd=\settowidth\rotheadsize{2020}\rothead},
             row{2}  = {cmd=\renewcommand\theadalign{bc}
                            \settowidth\rotheadsize{\theadfont Detection and}
                            \rothead},
             rowsep  = 4pt,
             measure = vbox,
             stretch = -1,
             }
Paper
    &   Scope 
        &   \SetCell[c=5]{c}    Topics
            &   &   &   &   &   Contribution
                                &   Drawbacks
                                    &   Year    \\
    &   & Architecture Design
            & Mobility
                & Security
                    & Privacy
                        & Detection and Prevention
                            &   &   &           \\
{[14]}    %\cite{139}
    & VFC environment 
        & \ding{51} & \ding{51} & \ding{51} & \ding{55} & \ding{55} 
            &   \begin{itemize}
            \item VFC architecture
            \item Security issues in VFC
                \end{itemize}
                &   \begin{itemize}
                \item Security solutions in VFC
                    \end{itemize}
                    & 2019      \\
{[15]}    %\cite{142}
    & VFC environment
        & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{55} 
            &   \begin{itemize}
            \item V2V and V2I in VEC
            \item Security and privacy in VEC
                \end{itemize}
                &   \begin{itemize}
                \item VFC and VEC comparison
                \item VEC security requirements
                    \end{itemize} 
                    & 2019      \\
{[16]}    %\cite{143}
    & FC in VANET 
        & \ding{51} & \ding{51} & \ding{51} & \ding{55} & \ding{55} 
            &   \begin{itemize}
            \item Connecting vehicles to VANET
            \item Security and forensics requirements
                \end{itemize} 
                &   \begin{itemize}
                \item Vehicles as Fog nodes
                \item Possible scenarios in VFC
                \item Detection and prevention in VFC
                    \end{itemize}
                    & 2017      \\
{[17]}    %\cite{146} 
    & VFC application  
        & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} 
            &   \begin{itemize}
            \item VFC : Video crowd-sourcing as a study case
                \end{itemize} 
                &   \begin{itemize}
                \item Security and privacy challenges
                \item Countermeasures for mitigation in VFC
                    \end{itemize} 
                    & 2018      \\
{[18]}    %\cite{149}
    & FC in VANET 
        & \ding{55} & \ding{55} & \ding{51} & \ding{51} & \ding{55} 
            &   \begin{itemize}
            \item Integration of FC in VANET
                \end{itemize}   
                &   \begin{itemize}
                \item Deployment on vehicles as fog nodes
                \item VFC applications
                    \end{itemize} 
                    & 2017      \\
{[19]}    %\cite{145}
    & VFC challenges 
        & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{55} 
            &   \begin{itemize}
            \item VFC taxonomy vehicles deployment in VFC
                \end{itemize}  
                &   \begin{itemize}
                \item VFC implementation requirements
                \item Detection and prevention in VFC
                    \end{itemize}  
                    & 2020      \\
{[20]}    %\cite{147}   
    & Dissemination of Data in VFC
        & \ding{51} & \ding{55} & \ding{51} & \ding{55} & \ding{55} 
            &   VCC vs VFC in:
                \begin{itemize}
            \item Data Dissemination
            \item Applications
            \item Security threats
                \end{itemize} 
                &   \begin{itemize}
                \item Privacy issues in VFC
                \item Misbehaving detection and prevention solutions
                    \end{itemize} 
                    & 2021      \\
\SetCell{cmd=\settowidth\rotheadsize{Our survey}\rothead} Our survey
    & VFC   
        & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51}
            &   \begin{itemize}
            \item VFC global architecture
            \item VFC implementation
            \item VFC scenarios
            \item Security and privacy threats
            \item Detection and prevention in VFC
                \end{itemize} 
                &   &           \\
\end{tblr}

\caption{Related Surveys Comparison}
\label{tab: RelatedSurveys}
    \end{table*}
\end{document}

在此处输入图片描述

相关内容