Table cellspacing with CSS

Posted by antpaw on Stack Overflow See other posts from Stack Overflow or by antpaw
Published on 2010-03-26T09:19:50Z Indexed on 2010/03/26 9:23 UTC
Read the original article Hit count: 192

Filed under:
|
|

hey, is it possible to add spacing between the cells?

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8" />
  <title>test</title>
  <style>
   #wrap {
    display: table-row;
    /* there is no also cellspacing in CSS afaik :( */
   }
   #wrap div {
    display: table-cell;
    /* margin: 40px; doesn't work for table-cell :( */
    /* border: 30px solid transparent; works but it's as good as adding padding */
    /* border: 30px solid white; works but the page background is invisible */

    /* decoration: */
    background-color: green;
    padding: 20px;
   }
  </style>
 </head>
 <body>
  <!-- don't touch the markup -->
  <div id="wrap">
   <div>text1</div>
   <div>text2</div>
  </div>
 </body>
</html>

© Stack Overflow or respective owner

Related posts about css

Related posts about table