Any table element will automatically generate necessary anonymous table objects around itself, consisting of at least three nested objects corresponding to a 'table'/'inline-table' element, a 'table-row' element, and a 'table-cell' element.
It does not need to be display: table. The difference, however, is worth to be mentioned: If you use display: block instead of display: table, your margins will collapse as usual. If you use display: table, however, you will lose margin collapse between siblings and the first/last children of the element where you've applied the clearfix on, which might or might not be a desired feature.
2015-08-01
涉及到margin折疊。
所以display:table 會(huì)產(chǎn)生匿名的table-cell元素,進(jìn)而產(chǎn)生BFC從而避免margin折疊。