HTML CSS examples for CSS Widget:Table Cell
Display: table-cell margins
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div.table { border:solid; border-width:3px; border-color:Chartreuse; display:table; border-collapse:separate; border-spacing:0 6px; width:100%; height:100px; margin:11px; background-color:yellow; } div.cell {<!-- w w w . j a v a 2s .c om--> border:solid; border-width:5px; border-color:blue; display:table-cell; } #c1 { width:401px; background-color:pink; border:0 none; background-clip:padding-box; border-right:6px solid OrangeRed; padding:6px; box-shadow:inset 0 0 0 4px red; } #c2 { width:201px; background-color:grey; } </style> </head> <body> <div class="table"> <div class="cell" id="c1"></div> <div class="cell" id="c2"></div> </div> </body> </html>