Created
March 26, 2012 06:53
-
-
Save tylercunnion/2203540 to your computer and use it in GitHub Desktop.
Modernizr test for table cell box model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Firefox does not use the correct box model when setting the height of table | |
* cells. See http://oldtinroof.com/2010/03/table-cell-min-height-in-firefox/. | |
* This Modernizr test returns true if the correct box model is adhered to. | |
*/ | |
Modernizr.addTest('table-content-box', function() { | |
var generatedHeight, td; | |
td = document.createElement('td'); | |
td.style['border'] = '1px solid black'; | |
td.style['height'] = '1px'; | |
document.body.appendChild(td); | |
generatedHeight = td.offsetHeight; | |
document.body.removeChild(td); | |
return generatedHeight === 3; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment