Alright guys and gals,
I’m pretty frustrated with box-sizing at the moment. Working on a client project and because of Mozilla’s odd decision to set border-box as the default value of box-sizing for tables in all the newer versions of Firefox, I am now dealing with inconsistency between FF3.6+ and Webkit browsers.
Particularly with my table header cells, here’s my code:
<table width="100%">
<thead>
<tr>
<th class="rc_provider">Provider</th>
<th class="rc_patient">Patient</th>
<th class="rc_phone">Phone</th>
<th class="rc_time">Time</th>
</tr>
</thead>
<tbody>
<tr>
<td class="rc_provider"><span class="content_icn phone16"></span><a href="#">Dr. Doug Parent MD</a></td>
<td class="rc_patient"><a href="#">Kevin Milden</a></td>
<td class="rc_phone">(805) 708-7308</td>
<td class="rc_time">12:30 PM</td>
</tr>
<tr class="even">
<td class="rc_provider"><span class="content_icn phone16"></span><a href="#">Dr. Doug Parent MD</a></td>
<td class="rc_patient"><a href="#">Kevin Milden</a></td>
<td class="rc_phone">(805) 708-7308</td>
<td class="rc_time">12:30 PM</td>
</tr>
...
div table {
border-collapse:collapse;
border-spacing:0;
border-width:0;
text-align:left;
-moz-box-sizing:content-box !important;
-ms-box-sizing:content-box !important;
-webkit-box-sizing:content-box !important;
box-sizing:content-box !important;
}
div table th {
background:url(../images/th_divider_grad.png) right bottom no-repeat;
border-bottom:1px solid #d1d1d1;
-moz-box-sizing:content-box !important;
-ms-box-sizing:content-box !important;
-webkit-box-sizing:content-box !important;
box-sizing:content-box !important;
font-size:11px;
font-weight:normal;
height:18px;
padding:15px 0 0 15px;
vertical-align:top;
}
As you can see there, even though Webkit’s default value is already set to content-box, I went ahead and set it for browser engines trying to force it and make sure it’s the same across the board. Well. It didn’t work, and it doesn’t even work for webkit when I try to force them all to have border-box instead, and make the necessary adjustments. I have spent hours researching and trying different things. I’ve done a search here in the forums with no results coming back.
What am I missing about how this property is implement in gecko and webkit? I’ve read the spec about box-sizing at W3C’s site, and have read some discussion about it on other forums and Q/A sites. If you check out Mozilla’s developer network CSS reference, it even states that the default value should be content-box, yet they didn’t implement it that way, for tables at least.
For the time being I’m using this fix that I’m not too happy with using, to declare a different height and padding for firefox:
@-moz-document url-prefix() {
div table th {
padding-top:15px !important;
height:33px !important;
}
}
I almost forgot to provide you with a view of the behavior, here’s a link where you can view the problem in Chrome/Safari and Firefox. The Dashboard (index) or Providers page both have tables that will demonstrate the issue. Currently I have the CSS uploaded w/out the FF fix i displayed up above, so that you may see the behavior:
http://dl.dropbox.com/u/37971131/RingRx/index.html
Please help!
-Alex966