Wie erstelle ich diese komplizierte Tabelle in Latex?

Wie erstelle ich diese komplizierte Tabelle in Latex?

Diese Tabelle hat einige zusammengeführte Zeilen und Spalten

Wie erstelle ich es? Und wie füge ich den Zellen Farben hinzu? Ich habe das Bild in der falschen Ausrichtung hochgeladen. Bitte korrigieren Sie es und helfen Sie mir. Danke.

Antwort1

Das wird zu meiner Pflicht :-)

\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}

Bildbeschreibung hier eingeben

verwandte Informationen