I have this working in every browser except Internet Explorer! I don't know why this is happening, and any information you can provide would be awesome! Check below for my code and what I've tried. This little web app is for a hotel I'm helping. You'll notice in my CSS
, the tbody
has overflow:auto
and that works in Chrome, Firefox, but not IE...
Here is my code:
CSS
tr, td, label{
font-family: arial, verdana, sans-serif;
text-align: center;
}
th{
font-weight: bold;
background-color: #380040;
text-align: center;
padding:20px 0;
color: #fff;
border-radius: 5px;
}
tr{
height: 20px;
}
td{
background-color: #444;
text-align: center;
color: #fff;
width: 180px;
padding: 10px;
}
thead{
display:block;
position: relative;
}
tbody{
height: 500px;
overflow: auto;
display: block;
}
HTML
<table>
<thead>
<tr>
<th width="188px">Room Number: </th>
<th width="193px">Room Charges:</th>
<th width="193px">Adult: </th>
<th width="212px">Status: </th>
</tr>
</thead>
<tbody>
<?php foreach($output['data']['rooms'] as $info): ?>
<tr>
<td><?php echo $info['room_number']; ?></td>
<?php $services = reset($info['services']); ?>
<td><?php echo ($services['room_charges']['enabled'] == 1) ? 'ENABLED' : 'DISABLED'; ?></td>
<td><?php echo ($services['adult']['enabled'] == 1) ? 'ENABLED' : 'DISABLED'; ?></td>
<td><?php echo $info['status']; ?></td>
</tr>
</body>
<?php endforeach; ?>
</tbody>
</table>
I'm actually building a dynamic table, but this question will still apply to the actual table. I've tried adding position:relative
to th
but that didn't work either. Any information would be great if you can point me in the right direction?
JSFIDDLE: http://jsfiddle.net/0aqmb2mq/