Create a table for an athletic knockout event

I have used LaTeX for fairly large documents in the past but not for diagrams.

I would like to create a table describing a knockout athletic event, for instance like the one found here in HTML.

How would I go about creating such a thing in LaTeX? Perhaps there is already a package for this and I couldn't find it. But if not, which packages would you advise me to study and combine?

-
 Welcome to TeX.sx! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are "too localized". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Martin Schröder Nov 22 '12 at 23:44 try the tikz-qtree package. – mythealias Nov 22 '12 at 23:52 Tikz is the way to go. Have a look at page 115 of the pgfmanual: ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/… – Vivi Nov 22 '12 at 23:54

You can produce the table using TikZ and its trees library; inside the tree the \Pair command (a two-column tabular) is used to fill the information; this command has four mandatory arguments:

\Pair{<team1>}{<score>}{<team2>}{<score>}


Here's the code:

\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}%
}
\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) {\Pair{Netherlands}{0}{Spain}{1}}
[edge from parent fork left,grow=left]
child {node (2) {\Pair{Netherlands}{4}{Uruguay}{2}}
child {node (3) {\Pair{Germany}{2}{Colombia}{1}}}
child {node {\Pair{Russia}{0}{Spain}{2}}}
}
child {node {\Pair{Germany}{0}{Spain}{1}}
child {node {\Pair{Germany}{2}{Colombia}{1}}}
child {node {\Pair{Russia}{0}{Spain}{2}}}
};
\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}


-

Something to get you started.

\documentclass{standalone}

\usepackage{tikz-qtree}

\begin{document}

\begin{tikzpicture}%
[ every text node part/.style={draw, align = left, inner sep = 0pt} ]

% Setup for horizontal tree
% Grow tree to right with nodes placed clockwise(')
\tikzset{grow'=left}
% Use edges with 90° bends instead of default straight
\tikzset{edge from parent/.style = { draw,
edge from parent path = { (\tikzparentnode.west)
-- +(-8pt, 0)
|- (\tikzchildnode.east) }}}
% Increase horizontal spacing (adjust if length of name is long)
\tikzset{level distance = 6em}
% Adjust the alignment of the nodes
\tikzset{every tree node/.style = {draw, anchor = base west}}

\Tree[ .{Team 1}
[     .{Team 1} {Team 2}
[.{Team 1} {Team 3} {Team 4} ] ]
[.{Team 5} {Team 5} {Team 6} ] ]
\end{tikzpicture}

\end{document}


result:

you can further edit the tree so that each node is a table. to better match the table you linked to.

-