如何在 LATEX 中绘制长表格我的表格有 6 列和脚注如果我可以在一页中得到整个表格,那将会非常麻烦

如何在 LATEX 中绘制长表格我的表格有 6 列和脚注如果我可以在一页中得到整个表格,那将会非常麻烦
Working Status  Suffering from  Chronic Disease Difficulty in Mobility  Activity of Daily Living    Sample (N)
Age                     
   <40  90.6    37.7    39.7    21.4    3155
   41-50    89.2    45.6    45.2    25.1    19821
   51-60    82.7    55.7    59.2    34.2    20934
   61-70    56.6    62.0    71.6    45.9    18076
   71+  29.7    65.5    83.8    64.1    10263
Sex                     
Male    73.5    54.5    56.3    31.6    30569
Female  64.3    56.2    65.8    44.4    41680
Place Of Residence                  
Rural   70.8    52.5    63.3    42.7    46534
Urban   66.0    61.8    58.5    31.1    25715
Education                   
No Education    65.9    52.2    66.3    49.3    33207
Primary 71.4    59.2    63.7    37.3    17735
Secondary   75.4    59.0    56.9    26.3    13949
Higher Secondary    73.0    54.4    46.3    14.7    3585
Graduation & Above  72.1    59.0    41.8    14.4    3773
Caste                   
SC/ST   72.0    49.5    62.1    40.5    24555
OBC 70.0    55.2    60.1    39.3    27183
Others  65.1    62.1    64.4    36.9    20511
Religion                    
Others  69.9    60.6    64.3    40.9    19277
Hindu   69.4    54.3    61.3    38.6    52972
MPCE Quintile                   
Poorest 68.5    48.0    60.9    41.8    14158
Poorer  68.9    53.7    63.1    41.4    14529
Middle  70.3    54.1    61.6    37.3    14537
Richer  69.8    59.2    62.2    39.2    14686
Richest 70.1    63.7    61.2    34.7    14339
Marital Status                  
Others  49.9    59.6    75.7    55.0    16850
Married 75.1    54.2    57.3    33.9    55395
Spouse Employment                   
No  61.8    58.8    65.7    42.0    45395
Yes 83.4    50.1    55.4    34.2    26854
Children Below 5 years                  
No Children 70.0    55.6    61.7    38.3    53271
Yes 68.0    55.2    62.0    41.0    18978
Children between 6 &  15 years                  
No Children 70.3    56.0    62.1    38.7    46322
Yes 67.9    54.5    61.3    39.5    25927
Physical Activity                   
   No   54.3    59.5    68.1    44.1    46805
   Yes  89.3    48.9    51.7    30.7    24807
Ever Consumed Alcohol                   
   Yes  75.6    52.0    57.0    34.0    11922
   No   67.9    56.3    63.1    40.2    59708
Ever Smoked                 
   Yes  70.6    54.0    63.0    39.9    24777
   No   68.5    56.6    61.8    39.0    46835
Total   69.5    55.5    61.8    39.8    72249**

答案1

作为起点,您应该如何将数据转换为 LaTeX 表。基于猜测您的数据是如何组织的:

\documentclass{report}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}

\begin{document}
\begin{talltblr}[
caption = {Unknown},
  label = {tab:??},
remark{Note} = {some text ... if exist},
                ]{
     colsep = 3pt,
    colspec = {     l
               *{3}{X[c, si={table-format=2.1}]} 
                    X[1.2, c, si={table-format=2.1}]
                    X[0.8, c, si={table-format=5.0,
                                group-minimum-digits=4}]
               },
     row{1} = {font=\small\bfseries, mode=text}
                }
    \toprule
{Working\\ Status}
            & {{{Suffering from}}}  
                    & {{{Chronic Disease}}}
                            & {{{Difficulty in Mobility}}}  
                                    & {{{Activity of Daily Living}}}                        
                                            & {{{Sample (N)}}}  \\
    \midrule
\SetCell[c=6]{l, font=\small\bfseries, bg=gray!30}    Age
            &       &       &       &       &           \\
    $<40$   & 90.6  & 37.7  & 39.7  & 21.4  & 3155      \\
    41 - 50 & 89.2  & 45.6  & 45.2  & 25.1  & 19821     \\
    51 - 60 & 82.7  & 55.7  & 59.2  & 34.2  & 20934     \\
    61 - 70 & 56.6  & 62.0  & 71.6  & 45.9  & 18076     \\
    71 +    & 29.7  & 65.5  & 83.8  & 64.1  & 10263     \\
\SetCell[c=6]{l, font=\small\bfseries, bg=gray!30}    Sex         
            &       &       &       &       &           \\ 
Male        & 73.5  & 54.5  & 56.3  & 31.6  & 30569     \\
Female      & 64.3  & 56.2  & 65.8  & 44.4  & 41680     \\
\SetCell[c=6]{l, font=\small\bfseries, bg=gray!30}    Place Of Residence
            &       &       &       &       &           \\
Rural       & 70.8  & 52.5  & 63.3  & 42.7  & 46534     \\
Urban       & 66.0  & 61.8  & 58.5  & 31.1  & 25715     \\
    \bottomrule
    \end{talltblr}
\end{document}

您可以按照上面的方式编辑其余数据。

在此处输入图片描述

相关内容