Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tournament brackets using only HTML tables and CSS

Tags:

html

css

Is there a way to display tournament bracket using only HTML table and CSS?

Here's what I want to achieve:

example tournament bracket

like image 637
mark yorky Avatar asked Sep 02 '13 04:09

mark yorky


People also ask

How do I make a tournament bracket in HTML?

select("div"). append("svg") . attr("height", height) . attr("width", width); var rounds = [32, 16, 8, 4, 2, 1] // Start drawing left side var i; rounds.

How do I use HTML and CSS in brackets?

Go to your CSS page and write the name of the section. For example: body, p, head, div class, etc. Put curly brackets: { } Inside of the curly brackets, state what you would like to change.

What is the difference between a bracket and a tournament?

A bracket or tournament bracket is a tree diagram that represents the series of games played during a knockout tournament. Different knockout tournament formats have different brackets; the simplest and most common is that of the single-elimination tournament.

How do brackets work in tournaments?

A tournament bracket pits an even number of teams in several rounds of games until there's only one team standing. A bracket contains a minimum of four games,, but usually the tournament field contains many more teams.


1 Answers

You can wrap the elements inside a position: relative; div element and than you can use position: absolute; nested div

Demo

Now obviously this will be a tedious process but you can use classes to track particular points but this is the best you can achieve with pure CSS.

For the last dashed div you can use the following snippet to achieve that effect

.last {
   border: 1px dashed #000;
   border-top: 1px solid #000;
   border-left: 0;
   /* Top Left for positioning */
}

Demo 2

Last but not the least, table won't be a good thing for this

like image 60
Mr. Alien Avatar answered Oct 30 '22 03:10

Mr. Alien