![Display table cell margin 0 auto](https://kumkoniak.com/16.jpg)
This was originally an older post that didn’t take into consideration possible use of the border-box property. This is just one of those things in CSS that seems easy to understand (and really, it should be), but it’s sometimes not - because of the way that percentages work in CSS. I’m sure CSS developers of all skill levels have attempted something similar to what I’ve just described, with bizarre results ultimately leading to head scratching and shruggingly resorting to experimenting with absolute widths until we find just the right fit. The screenshot above illustrates the final result we want to achieve: a table with the first row being the main header and multiple sections, which all have their subheaders. If you want a block-level element to fill any remaining space inside of its parent, then it’s simple - just add width: 100% in your CSS declaration for that element, and your problem is solved. margin on table elements border-radius on table elements z-index on table elements The table markup.
![display table cell margin 0 auto display table cell margin 0 auto](https://i.stack.imgur.com/XxT6g.png)
![display table cell margin 0 auto display table cell margin 0 auto](https://aws1.discourse-cdn.com/sitepoint/original/3X/9/b/9b8be72df7c0a6723ed4b2766db6746bcf923ed4.gif)
You can also supply header and footer views to provide additional information for groups of cells. It seems like this should be one of the easiest things to understand in CSS. The standard cell configurations display a simple combination of text and images, but you can define custom cells that display any content you want.
![Display table cell margin 0 auto](https://kumkoniak.com/16.jpg)