What I'm trying to create is a dynamic Tournament site that can be scaled to any size but using as little code as possible.
First round (of games): I have the first round up and running, and it's flexible for any size and it will look good no matter what I do with it.
Secound round: This is where the problem starts, because of my solution for the lines connecting all the games. The lines are simulated by the div classes .line-top & .line-bottom. However, since there are less games in round 2, and a bigger space between the games, the same line code can't be applied to every set of game in round 2. The first works fine, as you can see in the example, except for the line connecting them, which is also a problem. If I add another set of games in round 2 the code breaks, since there is need for a bigger space than the space that is above the first game. It needs the same space as between game 1 & game 2 in round 2. Check example and you will see what I mean.
To my real problem: How do I create a dynamic site that will adept depending on the amount of players that are in the tournament? And mainly, how do I deal with the lines? I need a line before every box, as well as fixing the space that is needed before game 3, and any other game that is added. The same problems will occur when I add a round 3 and a round 4 and so forth. The MAIN problem I guess is making the lines that connects the boxes, the horizontal ones, not the vertical ones. Now the boxes just lay ontop. There should be a horizontal line on the left of very box.
Is my approach to the problem already wrong? Is there a better solution for my lines and how I create the space above and below my games?
Site can be found here: http://jsfiddle.net/UZs4s/
HTML
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Tournament</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="round-1">
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-top"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-bottom"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-top"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-bottom"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-top"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-bottom"></div>
</div>
<div class="round-2">
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-top"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-bottom"></div>
<div class="game">
<div class="contender-1">
x
</div>
<div class="contender-2">
x
</div>
</div>
<div class="line-top"></div>
</div>
</div>
CSS
.contender-1,
.contender-2 {
font-family: Arial, sans-serif;
font-size: 12px;
width: 120px;
border: 1px solid #000;
padding-left: 2px;
background-color: #f1f1f1;
}
.contender-1 {
border-bottom: 0px;
}
.game {
margin-bottom: 16px;
float: left;
clear: both;
}
.round-1 .line-top {
float: left;
height: 35px;
width: 10px;
border-right: 1px solid #000;
margin-top: 18px;
border-top: 1px solid #000;
}
.line-bottom {
float: left;
height: 19px;
width: 10px;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
.round-1 {
float: left;
}
.round-2 {
float: left;
margin-top: 26px;
}
.round-2 .line-top {
float: left;
height: 85px;
width: 10px;
border-right: 1px solid #000;
margin-top: 18px;
border-top: 1px solid #000;
}