我如何在乳胶中创建这个复杂的表格?

我如何在乳胶中创建这个复杂的表格?

此表包含一些合并的行和列

我该如何创建它?如何为单元格添加一些颜色?我上传的图片方向错误。请纠正并帮助我。谢谢。

答案1

这成为我的义务:-)

\documentclass{article}
\usepackage[table]{xcolor}  %% for colors
\usepackage{multirow}  %% for \multirow
\usepackage{hhline}  %% for hhline gives better \cline while coloring
\usepackage{graphicx}  %% for \rotatebox
\newcolumntype{C}{>{\centering\arraybackslash}p{1cm}}

\begin{document}
\rowcolors{2}{gray!40}{gray!40}
%\renewcommand{\arraystretch}{1.1}
%\setlength{\arrayrulewidth}{0.6pt}
\begin{tabular}{|C|>{\columncolor{gray!40}}C|*{5}{C|}}\hhline{*{7}{-}}
   \multicolumn{2}{|c|}{\cellcolor{gray!40}}& \multicolumn{5}{c|}{\cellcolor{white}Group III} \\\hhline{~~*{5}{-}}
   \multicolumn{2}{|c|}{III--V} & 5 & 13 & 31 & 69 & 81 \\
   \multicolumn{2}{|c|}{Compounds} & B & Al & Ga & XX & XX \\\hhline{*{7}{-}}
   \hiderowcolors
   &  7 & XX & XX & XX & XX & XX \\
   &  XX &  &  & XX &  & \\\hhline{~*{6}{-}}
   &  7 & XX & XX & XX & XX & XX \\
   &  XX &  & XX & XX & XX & \\\hhline{~*{6}{-}}
   &  7 & XX & XX & XX & XX & XX \\
   &  XX &  &  & XX &  & \\\hhline{~*{6}{-}}
   &  7 & XX & XX & XX & XX & XX \\
   &  XX &  &  & XX &  & \\\hhline{~*{6}{-}}
   &  7 & XX & XX & XX & XX & XX \\
\multirow{-10}{*}{\rotatebox{90}{Group V}}
   &  XX &  &  & XX &  & \\\hhline{*{7}{-}}
\multicolumn{4}{|p{\dimexpr4cm+6\tabcolsep+3\arrayrulewidth\relax}|}{\cellcolor{gray!40} Some thing you put here} &
\multicolumn{3}{p{\dimexpr3cm+4\tabcolsep+2\arrayrulewidth\relax}|}{\cellcolor{gray!40} Some thing you put here Some thing you put here}\\\hhline{*{7}{-}}
\end{tabular}
\end{document}

在此处输入图片描述

相关内容