I have this screenshot. The one above is using div. The one below is using table. I tried making the one above look similar to the one below but I'm getting nowhere.
My aim is to simulate a stacked horizontal bar. I've found similar CSS examples on the net but it won't let me add the text inside the "box".
Code Example
br.clear {
float: clear;
}
div.fullwidth {
border: 1px solid black;
height: 40px;
max-width: 100px;
}
div.available {
background-color: #22BB22;
color: #111111;
float: left;
font-size: 20px;
height: 40px;
text-align: center;
line-height: 40px;
}
div.notavailable {
background-color: #222222;
color: #DDDDDD;
float: left;
font-size: 20px;
height: 40px;
text-align: center;
line-height: 40px;
}
<div class="fullwidth" style="height: 40px;">
<div class="available" width="50px">10</div>
<div class="notavailable" width="50px">10</div>
<br class="clear" />
</div>
<hr>
<table>
<tr>
<td style="background-color: green; width: 50px; text-align: center;">10</td>
<td style="background-color: blue; width: 50px; text-align: center;">10</td>
</table>