I was wondering why using padding on a "display: table;" was not working as I expect it should ;-).
.table {
display: table;
width: 100%;
background: firebrick;
color: white;
padding: 10px;
}
.table-cell {
display: table-cell;
background: seagreen;
}
<div class="table">
<div class="table-cell">
Why is the padding working like shit?
</div>
</div>
Here is the jsfiddle: http://jsfiddle.net/7n38t/
As you can see the "padding: 10px;" on ".table" is resulting in a table that is bigger than the frame... and the horizontal scrollbar appears.
Why is it reacting like this?? I don't want a workaround for this, because I have one, but I really want to understand why!
Thanks, Bastien