我的桌子之间有很多不必要的空间

我的桌子之间有很多不必要的空间

我是制作表格的新手,我对表格之间的空间感到困扰。

 \begin{table}[htbp]
  \centering
  \caption{Conferências, revistas e periódicos da IEEE de interesse}
  \begin{tabular}{>{\raggedright\arraybackslash}p{0.25\textwidth}>{\raggedright\arraybackslash}p{0.75\textwidth}}
    \rowcolor[gray]{0.9}\textbf{Acrônimos} & \textbf{Nome completo}\\
    \rowcolor{white}TrustCom & 2018 17th IEEE International Conference On Trust, Security And Privacy In Computing And Communications \\
    \rowcolor[gray]{0.9}BigDataSE & 12th IEEE International Conference On Big Data Science And Engineering\\
    \rowcolor{white}ICCCS & 2019 4th International Conference on Computing, Communications and Security \\
    \rowcolor[gray]{0.9}ATS & 2019 IEEE 28th Asian Test Symposium \\
    \rowcolor{white}MSR & 2019 IEEE/ACM 16th International Conference on Mining Software Repositories \\
    \rowcolor[gray]{0.9}ICOIN & 2019 International Conference on Information Networking \\
    \rowcolor{white}ISVLSI & 2020 IEEE Computer Society Annual Symposium on VLSI \\
    \rowcolor[gray]{0.9}ICAC & 2021 26th International Conference on Automation and Computing \\
    \rowcolor{white}INCET & 2021 2nd International Conference for Emerging  Technology \\
    \rowcolor[gray]{0.9}ICACCS & 2021 7th International Conference on Advanced Computing and Communication Systems \\
    \rowcolor{white}Big Data & 2021 IEEE International Conference on Big Data \\
   \rowcolor[gray]{0.9}ASIANCON & 2022 2nd Asian Conference on Innovation in Technology \\
    \rowcolor{white}NCCC & 2022 Fifth National Conference of Saudi Computers Colleges \\
   \rowcolor[gray]{0.9}CCNC & 2022 IEEE 19th Annual Consumer Communications \& Networking Conference \\
    \rowcolor{white}TrustCom & 2022 IEEE International Conference on Trust, Security and Privacy in Computing and Communications \\
   \rowcolor[gray]{0.9}DISCOVER & 2022 International Conference on Distributed Computing, VLSI, Electrical Circuits and Robotics \\
    \rowcolor{white}ICIMCIS & 2022 International Conference on Informatics, Multimedia, Cyber and Information System \\
    \rowcolor[gray]{0.9}MLCSS & 2022 International Conference on Machine Learning, Computer Systems and Security \\
  \end{tabular}
\end{table}

\begin{table}[htbp]
  \centering
  \caption{Tabela de Critérios de Inclusão e Exclusão}
  \begin{tabular}{>{\raggedright\arraybackslash}p{0.3\textwidth}>{\raggedright\arraybackslash}p{0.7\textwidth}}
    \rowcolor[gray]{0.9}\textbf{Critérios de Inclusão} &\\
    \rowcolor{white}IC1 & O artigo foi publicado entre 2018-2022 \\
    \rowcolor[gray]{0.9}IC2 & O artigo está no contexto de Vírus de computador e propõe uma abordagem para análise e detecção do vírus\\
    \rowcolor{white}\textbf{Critérios de Exclusão} & \\
    \rowcolor[gray]{0.9}EC1 & O artigo não foi publicado em uma conferência, periódico ou revista listados na Tabela 1 e 2 \\
    \rowcolor{white}EC2 & O manuscrito é um livro ou artigo de acesso antecipado\\
  \end{tabular}
\end{table}

这是我的代码,但是当我编译时,表格之间有一个很大的空白: 大空间

我究竟做错了什么?

答案1

@David Carlisle 说,您的桌子的定位是符合预期的。

如果您在第二个表格后添加一些文本,并更改​​页面上文本和浮动元素之间的空间比例,则两个浮动元素都将被推到页面顶部。例如:

\documentclass{article}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                             % for dummy text
%---------------------------------------------------------------%
\renewcommand{\textfraction}{.05}     % <---
\renewcommand{\floatpagefraction}{.9} % <---

\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\usepackage{float}

\begin{document}
    \begin{table}[htbp]
\caption{Conferências, revistas e periódicos da IEEE de interesse}
\begin{tblr}{colspec  = {Q[l, wd=0.2\linewidth] X[l]},
             row{odd} = {bg=gray!10},
             row{1}   = {font=\bfseries}
             }
Acrônimos   &   Nome completo       \\
TrustCom    & 2018 17th IEEE International Conference On Trust, Security And Privacy In Computing And Communications \\
BigDataSE   & 12th IEEE International Conference On Big Data Science And Engineering\\
ICCCS       & 2019 4th International Conference on Computing, Communications and Security \\
ATS         & 2019 IEEE 28th Asian Test Symposium \\
MSR         & 2019 IEEE/ACM 16th International Conference on Mining Software Repositories \\
ICOIN       & 2019 International Conference on Information Networking \\
ISVLSI      & 2020 IEEE Computer Society Annual Symposium on VLSI \\
ICAC        & 2021 26th International Conference on Automation and Computing \\
INCET       & 2021 2nd International Conference for Emerging  Technology \\
ICACCS      & 2021 7th International Conference on Advanced Computing and Communication Systems \\
Big Data    & 2021 IEEE International Conference on Big Data \\
ASIANCON    & 2022 2nd Asian Conference on Innovation in Technology \\
NCCC        & 2022 Fifth National Conference of Saudi Computers Colleges \\
CCNC        & 2022 IEEE 19th Annual Consumer Communications \& Networking Conference \\
TrustCom    & 2022 IEEE International Conference on Trust, Security and Privacy in Computing and Communications \\
DISCOVER    & 2022 International Conference on Distributed Computing, VLSI, Electrical Circuits and Robotics \\
ICIMCIS     & 2022 International Conference on Informatics, Multimedia, Cyber and Information System \\
MLCSS       & 2022 International Conference on Machine Learning, Computer Systems and Security \\
  \end{tblr}
\end{table}

\begin{table}[htbp]
  \caption{Tabela de Critérios de Inclusão e Exclusão}
\begin{tblr}{colspec  = {Q[l, wd=0.2\linewidth] X[l]},
             row{odd} = {bg=gray!10},
             row{1}   = {font=\bfseries}
             }
Critérios de Inclusão
        &   \\
IC1     & O artigo foi publicado entre 2018-2022 \\
IC2     & O artigo está no contexto de Vírus de computador e propõe uma abordagem para análise e detecção do vírus\\
\textbf{Critérios de Exclusão}
        &   \\
EC1     & O artigo não foi publicado em uma conferência, periódico ou revista listados na Tabela 1 e 2 \\
EC2     & O manuscrito é um livro ou artigo de acesso antecipado\\
  \end{tblr}
\end{table}

\lipsum[66]   % <--- dummy text filler
\end{document}

在此处输入图片描述

tabularrray如您所见,我使用包代替了导致表格从文本块右侧边框突出的表格代码,X[l]作为第二列表格。这样也简化了行的着色。

由于表格出现的上下文未知(它们是单独的吗?),您可以使用float包并只编写这两个表格,如下所示:

\documentclass{article}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\usepackage{float}

\begin{document}
    \begin{table}[H]
\caption{Conferências, revistas e periódicos da IEEE de interesse}
\begin{tblr}{colspec  = {Q[l, wd=0.2\linewidth] X[l]},
             row{odd} = {bg=gray!10},
             row{1}   = {font=\bfseries}
             }
Acrônimos   &   Nome completo       \\
TrustCom    & 2018 17th IEEE International Conference On Trust, Security And Privacy In Computing And Communications \\
BigDataSE   & 12th IEEE International Conference On Big Data Science And Engineering\\
ICCCS       & 2019 4th International Conference on Computing, Communications and Security \\
ATS         & 2019 IEEE 28th Asian Test Symposium \\
MSR         & 2019 IEEE/ACM 16th International Conference on Mining Software Repositories \\
ICOIN       & 2019 International Conference on Information Networking \\
ISVLSI      & 2020 IEEE Computer Society Annual Symposium on VLSI \\
ICAC        & 2021 26th International Conference on Automation and Computing \\
INCET       & 2021 2nd International Conference for Emerging  Technology \\
ICACCS      & 2021 7th International Conference on Advanced Computing and Communication Systems \\
Big Data    & 2021 IEEE International Conference on Big Data \\
ASIANCON    & 2022 2nd Asian Conference on Innovation in Technology \\
NCCC        & 2022 Fifth National Conference of Saudi Computers Colleges \\
CCNC        & 2022 IEEE 19th Annual Consumer Communications \& Networking Conference \\
TrustCom    & 2022 IEEE International Conference on Trust, Security and Privacy in Computing and Communications \\
DISCOVER    & 2022 International Conference on Distributed Computing, VLSI, Electrical Circuits and Robotics \\
ICIMCIS     & 2022 International Conference on Informatics, Multimedia, Cyber and Information System \\
MLCSS       & 2022 International Conference on Machine Learning, Computer Systems and Security \\
  \end{tblr}
\end{table}

\begin{table}[H]
  \caption{Tabela de Critérios de Inclusão e Exclusão}
\begin{tblr}{colspec  = {Q[l, wd=0.2\linewidth] X[l]},
             row{odd} = {bg=gray!10},
             row{1}   = {font=\bfseries}
             }
Critérios de Inclusão
        &   \\
IC1     & O artigo foi publicado entre 2018-2022 \\
IC2     & O artigo está no contexto de Vírus de computador e propõe uma abordagem para análise e detecção do vírus\\
\textbf{Critérios de Exclusão}
        &   \\
EC1     & O artigo não foi publicado em uma conferência, periódico ou revista listados na Tabela 1 e 2 \\
EC2     & O manuscrito é um livro ou artigo de acesso antecipado\\
  \end{tblr}
\end{table}

\end{document}

在此处输入图片描述

相关内容