CSS table border spacing inside only

后端 未结 7 620
心在旅途
心在旅途 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:23

    Here is the cool hack to do that

    table {
        border-collapse: inherit;
        border-spacing: 10px;
        width: calc(100% + 20px);
        margin-left: -10px;
    }
    

    use margin-left: -10px; to remove left padding but in the right there will be 20px padding. Now to update it use width: calc(100% + 20px);

    0 讨论(0)
提交回复
热议问题