带有水平单元格的表格

带有水平单元格的表格

有人知道如何制作这个表格吗?我试过这个代码。在此处输入图片描述

\begin{table}[h]
\centering
\begin{tabular}{clrr}
\multicolumn{1}{c}{Order} & \multicolumn{1}{c}{Family} & \multicolumn{1}{c}{Species}\\ \hline
\multirow{4}{*}{\rotatebox{90}{\parbox[c]{2cm}{\centering Galliformes}}} & Numididae & Tas2r40 \textit{Numida meleagris}\\
& Odontophoridae & Tas2r40 \textit{Odontophorus gujanensis}\\
& Cracidae & Tas2r40 \textit{Penelope pileata}\\
& Phasianidae & Tas2r40 \textit{Phasianus colchius}\\
\multirow{3}{*}{\rotatebox{90}{\parbox[c]{3cm}{\centering Charadriiformes}}} &&\\ 
& Alcidae & Tas2r40 \textit{Alca torda}\\
& Laridae & Tas2r40 \textit{Rynchops niger}\\
& Thinocoridae & Tas2r40 \textit{Thinocorus orbignyianus}\\
\multirow{6}{*}{\rotatebox{90}{\parbox[c]{4cm}{\centering Struthioniformes}}} & Apterygidae & Tas2r40 \textit{Apteryx australis}\\
\multirow{6}{*}{\rotatebox{90}{\parbox[c]{5cm}{\centering Pelecaniformes}}} &&\\
& Ardeidae & Tas2r40 \textit{Egretta garzetta}\\
&&
&&
&&
&&
\multirow{5}{*}{\rotatebox{90}{\parbox[c]{7cm}{\centering Suliformes}}} &&\\
&&
&&
& Phalacrocoracidae & Tas2r40 \textit{Phalacrocorax auritus}\\
& Sulidae & Tas2r40 \textit{Sula dactylatra}\\
&&
&&
&&
&&
\multirow{12}{*}{\rotatebox{90}{\parbox[c]{5cm}{\centering Passeriformes}}} & Formicariidae & Tas2r40 \textit{Grallaria varia}\\
& Fringillidae & Tas2r40 \textit{Hemignathus wilsoni}\\
& Irenidae & Tas2r40 \textit{Irena cyanogastra}\\
& Irenidae & Tas2r40 \textit{Irena cyanogastra}\\
& Maluridae & Tas2r40 \textit{Malurus elegans}\\
& Monarchidae & Tas2r40 \textit{Myiagra hebitor}\\
& Orthonychidae & Tas2r40 \textit{Orthonyx spaldingii}\\
& Pachycephalidae & Tas2r40 \textit{Pachycephala phillipensis}\\
& Peucedramidae & Tas2r40 \textit{Peucedramus taeniatus}\\
& Picathartidae & Tas2r40 \textit{Picathartes gymnocephalus}\\
& Sapayoaidae & Tas2r40 \textit{Sapayoa aenigma}\\
& Zosteropidae & Tas2r40 \textit{Zosterops lateralis}\\
\end{tabular}
\end{table}

答案1

猜测(因为您没有提供有关文档页面布局的任何信息)...

在此处输入图片描述

\documentclass{article}
\usepackage{rotating}
\usepackage{makecell, multirow} 
\makeatletter
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2}\endturn}}
\makeatother

\begin{document}
    \begin{table}[h]
    \centering
    \setcellgapes{2.4pt}
    \makegapedcells
    \settowidth\rotheadsize{Passeriformes}
\begin{tabular}{cl r@{\ }>{\itshape}l}
\thead{Order} 
    & \thead{Family}    & \multicolumn{2}{c}{\thead{Species}}    \\ 
    \hline
\multirow{4.5}{*}{\rothead[c]{Galliformes}}
    & Numididae         & Tas2r40   & Numida meleagris          \\
    & Odontophoridae    & Tas2r40   & Odontophorus gujanensis   \\
    & Cracidae          & Tas2r40   & Penelope pileata          \\
    & Phasianidae       & Tas2r40   & Phasianus colchius        \\
    \hline
\multirow{5.4}{*}{\rothead[c]{Charadrii-\\ formes}}
    &                   &           &                           \\
    & Alcidae           & Tas2r40   & Alca torda                \\
    & Laridae           & Tas2r40   & Rynchops niger            \\
    & Thinocoridae      & Tas2r40   & Thinocorus orbignyianus   \\
    &                   &           &                           \\
    \hline
\multirow{5}{*}{\rothead[c]{Struthioni-\\ formes}}
    &                   &           &                           \\
    &                   &           &                           \\
    & Apterygidae       & Tas2r40   & Apteryx australis         \\
    &                   &           &                           \\
    &                   &           &                           \\
    \hline
\multirow{3}{*}{\rothead[c]{Pelecani-\\ formes}}
    &                   &           &                           \\
    & Ardeidae          & Tas2r40   & Egretta garzetta          \\
    &                   &           &                           \\
    \hline
\multirow{4}{*}{\rothead[c]{Suli-\\ formes}}
    &                   &           &                           \\
    & Phalacrocoracidae & Tas2r40   & Phalacrocorax auritus     \\
    & Sulidae           & Tas2r40   & Sula dactylatra           \\
    &                   &           &                           \\
    \hline
\multirow{12}{*}{\rothead{Passeriformes}}
    & Formicariidae     & Tas2r40   & Grallaria varia           \\
    & Fringillidae      & Tas2r40   & Hemignathus wilsoni       \\
    & Irenidae          & Tas2r40   & Irena cyanogastra         \\
    & Irenidae          & Tas2r40   & Irena cyanogastra         \\
    & Maluridae         & Tas2r40   & Malurus elegans           \\
    & Monarchidae       & Tas2r40   & Myiagra hebitor           \\
    & Orthonychidae     & Tas2r40   & Orthonyx spaldingii       \\
    & Pachycephalidae   & Tas2r40   & Pachycephala phillipensis \\
    & Peucedramidae     & Tas2r40   & Peucedramus taeniatus     \\
    & Picathartidae     & Tas2r40   & Picathartes gymnocephalus \\
    & Sapayoaidae       & Tas2r40   & Sapayoa aenigma           \\
    & Zosteropidae      & Tas2r40   & Zosterops lateralis       \\
    \hline
\end{tabular}
\end{table}
\end{document}

不过,我更喜欢下面的表格设计:

在此处输入图片描述

\documentclass{article}
\usepackage{array, booktabs} %
\newcommand\mc[1]{\multicolumn{4}{l}{#1}}
\begin{document}
    \begin{table}[h]
    \centering
\begin{tabular}{cl >{Tas2r40}r@{\ }>{\itshape}l}
\textbf{Order} 
    & \textbf{Family}    & \multicolumn{2}{l}{\textbf{Species}} \\ 
    \midrule
\mc{Galliformes}                                                \\
    & Numididae         && Numida meleagris          \\
    & Odontophoridae    && Odontophorus gujanensis   \\
    & Cracidae          && Penelope pileata          \\
    & Phasianidae       && Phasianus colchius        \\
    \midrule
\mc{Charadriiformes}                                            \\
    & Alcidae           && Alca torda                \\
    & Laridae           && Rynchops niger            \\
    & Thinocoridae      && Thinocorus orbignyianus   \\
     \midrule
\mc{Struthioniformes}                                           \\
    & Apterygidae       && Apteryx australis         \\
    \midrule
\mc{Pelecaniformes}                                             \\
    & Ardeidae          && Egretta garzetta          \\
    \midrule
\mc{Suliformes}                                                 \\
    & Phalacrocoracidae && Phalacrocorax auritus     \\
    & Sulidae           && Sula dactylatra           \\
    \midrule
\mc{Passeriformes}                                              \\
    & Formicariidae     && Grallaria varia           \\
    & Fringillidae      && Hemignathus wilsoni       \\
    & Irenidae          && Irena cyanogastra         \\
    & Irenidae          && Irena cyanogastra         \\
    & Maluridae         && Malurus elegans           \\
    & Monarchidae       && Myiagra hebitor           \\
    & Orthonychidae     && Orthonyx spaldingii       \\
    & Pachycephalidae   && Pachycephala phillipensis \\
    & Peucedramidae     && Peucedramus taeniatus     \\
    & Picathartidae     && Picathartes gymnocephalus \\
    & Sapayoaidae       && Sapayoa aenigma           \\
    & Zosteropidae      && Zosterops lateralis       \\
    \bottomrule
\end{tabular}
\end{table}
\end{document}

相关内容