سلام
شما باید با توجه به ساختار داده و مشابه آن، مواردی را معرفی کنید.
من دو دستور\MPair
و \SPair
را در زیر معرفی کردهام:
\newcommand\MPair[6]{%
\arrayrulecolor{cyan!60!black!40}%
\arrayrulewidth=1pt
\renewcommand\extrarowheight{1.5pt}%
\begin{tabular}{|p{2cm}|>{\centering\arraybackslash}p{10pt}|}
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#1} & \textcolor{red!60!black}{#2} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#3} & \textcolor{red!60!black}{#4} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#5} & \textcolor{red!60!black}{#6} \\
\hline
\end{tabular}%
}
\newcommand\SPair[8]{%
\arrayrulecolor{cyan!60!black!40}%
\arrayrulewidth=1pt
\renewcommand\extrarowheight{1.5pt}%
\begin{tabular}{|p{2cm}|>{\centering\arraybackslash}p{10pt}|}
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#1} & \textcolor{red!60!black}{#2} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#3} & \textcolor{red!60!black}{#4} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#5} & \textcolor{red!60!black}{#6} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#7} & \textcolor{red!60!black}{#8} \\
\hline
\end{tabular}%
}
برای موارد دیگر مشابه بالا عمل کنید.
دستورات شما مطابق زیر است:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{trees}
\newcommand\Pair[4]{%
\arrayrulecolor{cyan!60!black!40}%
\arrayrulewidth=1pt
\renewcommand\extrarowheight{1.5pt}%
\begin{tabular}{|p{2cm}|>{\centering\arraybackslash}p{10pt}|}
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#1} & \textcolor{red!60!black}{#2} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#3} & \textcolor{red!60!black}{#4} \\
\hline
\end{tabular}%
}
\newcommand\MPair[6]{%
\arrayrulecolor{cyan!60!black!40}%
\arrayrulewidth=1pt
\renewcommand\extrarowheight{1.5pt}%
\begin{tabular}{|p{2cm}|>{\centering\arraybackslash}p{10pt}|}
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#1} & \textcolor{red!60!black}{#2} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#3} & \textcolor{red!60!black}{#4} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#5} & \textcolor{red!60!black}{#6} \\
\hline
\end{tabular}%
}
\newcommand\SPair[8]{%
\arrayrulecolor{cyan!60!black!40}%
\arrayrulewidth=1pt
\renewcommand\extrarowheight{1.5pt}%
\begin{tabular}{|p{2cm}|>{\centering\arraybackslash}p{10pt}|}
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#1} & \textcolor{red!60!black}{#2} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#3} & \textcolor{red!60!black}{#4} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#5} & \textcolor{red!60!black}{#6} \\
\hline
\rowcolor{cyan!60!black!10}\textcolor{red!60!black}{#7} & \textcolor{red!60!black}{#8} \\
\hline
\end{tabular}%
}
\begin{document}
\begin{tikzpicture}[
level distance=5cm,every node/.style={minimum width=3cm,inner sep=0pt},
edge from parent/.style={cyan!70!black,ultra thick,draw},
level 1/.style={sibling distance=4cm},
level 2/.style={sibling distance=2cm},
legend/.style={draw=orange,fill=orange!30,inner sep=3pt}
]
\node (1) {\MPair{Netherlands}{0}{Spain}{1}{Iran}{20}}
[edge from parent fork left,grow=left]
child {node (2) {\Pair{Netherlands}{4}{Uruguay}{2}}
child {node (3) {\MPair{Germany}{2}{Colombia}{1}{Iran}{20}}}
child {node {\MPair{Iran}{20}{Spain}{2}{Spain}{2}}}
}
child {node {\MPair{Germany}{0}{Spain}{1}{Spain}{2}}
child {node {\MPair{Germany}{2}{Colombia}{1}{Spain}{1}}}
child {node {\SPair{Iran}{20}{Iran}{20}{Iran}{20}{Iran}{20}}}
};
\node[legend] at ([yshift=50pt]3) (QF) {Quarter Finals};
\node[legend] at (2|-QF) {Semi-Finals};
\node[legend] at (1|-QF) (QF) {Final};
\end{tikzpicture}
\end{document}
خروجی شما به صورت زیر است:
موفق باشید.