如何将包含多列的表拆分成两块?

如何将包含多列的表拆分成两块?

我有一张 16 列的表格,在 A4 纸上阅读起来非常困难。我想要将这张表格拆分成两个表格,每个表格各占一半的列,然后将它们一个放在另一个上面,第一个表格向左对齐,第二个表格向右对齐。

这是我的表的代码:

\begin{table}[ht]
    \caption{A sample of the Smartphones Database} % title of Table
    \label{tab:smartphonesDB}
    \centering % used for centering table
    \gdef\rownumber{}
    
    \resizebox{\textwidth}{!}{
        \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
            \hline
            %\rowcolor{LightGray}
            \textbf{Make} & \textbf{Model} & \thead{\textbf{CPU}\\\textbf{Make}} &
            \thead{\textbf{CPU}\\\textbf{Model}} &
            \textbf{GPU} &
            \textbf{Storage} &
            \thead{\textbf{Removable}\\\textbf{Storage}} &
            \textbf{RAM} & \textbf{OS} & \textbf{Height} &
            \textbf{Width} & \textbf{Depth} & \textbf{Weight} & \thead{\textbf{Display}\\\textbf{Size}} &
            \thead{\textbf{Dispaly}\\\textbf{Type}} &
            \thead{\textbf{Camera}\\\textbf{Resolution}}\\
            \hline          
            Google & \shortstack{Pixel\\4} & Qualcomm & \shortstack{Snapdragon\\855} & \shortstack{Adreno\\640} & 128 & 0   & 6 & \shortstack{Android\\10}  & 147.1 & 68.8 & 8.2 & 162 & 5.7 & OLED & 12\\
            \hline
            Google& \shortstack{Pixel\\4 XL} & Qualcomm &   \shortstack{Snapdragon\\855} &  \shortstack{Adreno\\640}    & 128   & 0 &   6   & \shortstack{Android\\10} &    160.4 & 75.1 &  8.2 &   193 & 6.3 & OLED &  12\\
            \hline
            OnePlus & 7 &   Qualcomm &  \shortstack{Snapdragon\\855} &  \shortstack{Adreno\\640} &  256 & 0 & 8 & \shortstack{Android\\9.0 Pie} &   157.7 & 74.8 & 8.2 & 182 & 6.4 & AMOLED & 48\\
            \hline
            OnePlus & 7 Pro&    Qualcomm&\shortstack{Snapdragon\\855}&\shortstack{Adreno\\640}  &256&   0   &12&\shortstack{Android\\ 9.0 Pie}& 162.6&  75.9&   8.8&    206&    6.7&    AMOLED& 48\\
            \hline
            Asus & \shortstack{ZenFone\\6} & Qualcomm&\shortstack{Snapdragon\\855}& \shortstack{Adreno\\640}&   256&    1024&   8   &\shortstack{Android\\9.0 Pie}& 159.1&  75.4&   9.2&    190&    6.4&    IPS LCD&    48\\
            \hline
            Vivo&   iQOO&   Qualcomm&\shortstack{Snapdragon\\855}&  \shortstack{Adreno\\640}&   256&    0   &12&\shortstack{Android\\9.0 Pie}&  157.7&  75.2&   8.5&    196 &6.4    &AMOLED &12\\
            \hline
            Vivo&\shortstack{iQOO\\Neo 855}&    Qualcomm&\shortstack{Snapdragon\\855}   &\shortstack{Adreno\\640}&  256&    0&  8&\shortstack{Android\\9.0 Pie} &159.5& 75.2&   8.1&    199 &6.4&   AMOLED& 12\\
            \hline
            Nokia&\shortstack{9\\PureView}& Qualcomm&\shortstack{Snapdragon\\845}&\shortstack{Adreno\\630}& 128 &512&   6&  \shortstack{Android\\9.0 Pie}&  155.0&  75.0&   8.0 &172&   6.0&    P-OLED& 12\\
            \hline
            Sharp&\shortstack{Aquos\\Zero}& Qualcomm&\shortstack{Snapdragon\\845}&\shortstack{Adreno\\630}& 128 &0  &6& \shortstack{Android\\9.0 Pie}&  154.0&  73.0&   8.8&    146 &6.2&   OLED&   22\\
            \hline
            Vivo&\shortstack{iQOO\\Neo}&    Qualcomm&\shortstack{Snapdragon\\845}&\shortstack{Adreno\\630}& 128 &0& 8&  \shortstack{Android\\ 9.0 Pie}& 159.5&  75.2&   8.1 &199&   6.4&    AMOLED& 12\\
            \hline
        \end{tabular}
    }
\end{table}

并显示为

在此处输入图片描述

我怎样才能创建如下所示的内容?

[Table with first 8 columns]
[Table with first 8 columns]
[Table with first 8 columns]
[Table with first 8 columns]
                 [Table with next 8 columns]
                 [Table with next 8 columns]
                 [Table with next 8 columns]
                 [Table with next 8 columns]

答案1

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx, makecell}
\begin{document}
    \begin{table}[ht]
        \caption{A sample of the Smartphones Database} % title of Table
        \label{tab:smartphonesDB}
        \centering % used for centering table
        \gdef\rownumber{}
\noindent\hspace{-3cm}
            \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
                \hline
                %\rowcolor{LightGray}
                \textbf{Make} 
                    & \textbf{Model} 
                        & \thead{\textbf{CPU}\\\textbf{Make}} 
                            &\thead{\textbf{CPU}\\\textbf{Model}} 
                                &\textbf{GPU} 
                                    &\textbf{Storage} 
                                        &\thead{\textbf{Removable}\\\textbf{Storage}} 
                                            &\textbf{RAM} \\
                \hline          
            \end{tabular}


\vspace{1cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
    \hline
    \textbf{OS} 
        & \textbf{Height} 
            &\textbf{Width} 
                & \textbf{Depth} 
                    & \textbf{Weight} 
                        & \thead{\textbf{Display}\\\textbf{Size}} 
                            &\thead{\textbf{Dispaly}\\\textbf{Type}} 
                                &\thead{\textbf{Camera}\\\textbf{Resolution}}\\
    \hline          
    
\end{tabular}
    \end{table}
\end{document}

编辑——显示连接箭头

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{ makecell}
\usepackage{tikz}
\newcommand\tikznode[3][]%
{\tikz[remember picture,baseline=(#2.base)]
    \node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
\begin{document}
    \begin{table}[ht]
        \caption{A sample of the Smartphones Database} % title of Table
        \label{tab:smartphonesDB}
        \centering % used for centering table
        \gdef\rownumber{}
        \noindent\hspace{-3cm}
        \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
            \hline
            %\rowcolor{LightGray}
            \textbf{Make} 
            & \textbf{Model} 
            & \thead{\textbf{CPU}\\\textbf{Make}} 
            &\thead{\textbf{CPU}\\\textbf{Model}} 
            &\textbf{GPU} 
            &\textbf{Storage} 
            &\thead{\textbf{Removable}\\\textbf{Storage}} 
            &\textbf{\tikznode{PT}RAM} \\
            \hline          
        \end{tabular}
        
        
        \vspace{1cm}
        \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
            \hline
            \textbf{\tikznode{PB0}OS} 
            & \textbf{Height} 
            &\textbf{Width} 
            & \textbf{Depth} 
            & \textbf{Weight} 
            & \thead{\textbf{Display}\\\textbf{Size}} 
            &\thead{\textbf{Dispaly}\\\textbf{Type}} 
            &\thead{\textbf{Camera}\\\textbf{Resolution}}\\
            \hline          
            
        \end{tabular}
    \begin{tikzpicture}[remember picture,overlay,cyan,rounded corners,>=stealth,shorten > =1pt,shorten <=1pt,thick]
        \draw[->] (PT)++(1,0)--+(1,0)--+(0,-1) -| (PB0);
    \end{tikzpicture}
    \end{table}
\end{document}

相关内容