如何在乳膠中創建這個複雜的表格?

如何在乳膠中創建這個複雜的表格?

表格有一些合併的行和列

我該如何創建它?另外如何為儲存格添加一些顏色?我上傳的圖像方向錯誤。請糾正並幫助我。謝謝。

答案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}

在此輸入影像描述

相關內容