CSS table border spacing inside only

后端 未结 7 624
心在旅途
心在旅途 2021-02-02 05:54

I have trying to work this out for months, and Google hasn\'t helped me. I\'m trying to have spacing between and tags in a table,

7条回答
  •  梦如初夏
    2021-02-02 06:10

    Here is a simple and clean solution.

    HTML

    One
    Two
    Three
    Four

    CSS

    .column-container {
      display: table;
      overflow: hidden;
    }
    
    .column-children-wrapper {
      border-spacing: 10px 0;
      margin-left: -10px;
      margin-right: -10px;
      background-color: blue;
    }
    
    .column {
      display: table-cell;
      background-color: red;
    }
    

    https://jsfiddle.net/twttao/986t968c/

提交回复
热议问题