I'm trying to implement time table (for online record to a doctor). My code is:
<div class="container">
<div class="record-container">
<div class="time-container" style="padding-top:5px">
<div class="time-table btn-group" data-toggle="buttons">
<div class="time-table-row">
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">10:00</label></div>
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">11:00</label></div>
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">12:00</label></div>
</div>
<div class="time-table-row">
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">10:20</label></div>
<div class="rec-time"><label class="btn btn-block busy-time disabled"><input type="radio">11:20</label></div>
<div class="rec-time"><label class="btn btn-block busy-time disabled"><input type="radio">12:20</label></div>
</div>
<div class="time-table-row">
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">10:40</label></div>
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">11:40</label></div>
<div class="rec-time"><label class="btn btn-block free-time"><input type="radio">12:40</label></div>
</div>
</div><!--time-table-->
</div> <!--time-container-->
</div> <!--record-container-->
</div> <!--container-->
CSS:
.record-container {
width: 100%;
height: 440px;
}
.time-container {
margin-left: 240px;
height: 240px;
}
.time-table {
display: table;
width: 100%;
height: 100%;
}
.time-table-row {
display: table-row;
}
.rec-time {
display: table-cell;
width: 11%;
vertical-align: bottom;
padding: 5px 5px;
font-family: 'Roboto', sans-serif;
color: #fff;
}
.btn {
font-size: 16px;
font-weight: 180;
width: 82px;
}
.free-time {
background: #5ece52;
}
.busy-time {
background: #de0000;
}
The first problem is the appearance of the buttons. The second is that buttons aren't in the group. I've found out that this is because of <div class="rec-time">
.
I've tried many layouts but I could not get to the table was same as it's now and with the group of radio buttons (that look like buttons).
How to fix it?
UPDATE: The second problem was really in the absence of the name and id attributes. As for the appearance of buttons, I've had to add an attribute style="display:none"
to the element <input ...>
to remove the icon of radio button.
But I can't understand why the styles of parent elements (display: table-row;
and display: table-cell;
) affect so?