Table padding not working

前端 未结 4 1996
南旧
南旧 2021-02-18 15:26

I have a table that sits within a parent div full of body text and other content. I have the following CSS which does not seem to work:

table {width:100%; paddin         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-02-18 16:05

    The prior answer shows that css can set border-[direction] for ea direction separately. But a much simpler css-only solution that replicates the old-style table cellpadding="7" border="1" can be the following. In CSS:

    table { 
      border-collapse:collapse;
      width: 100%;
    }
    td {
      padding: 7px;
      border:1px solid;
    } 
    

    Shown in this fiddle: http://jsfiddle.net/b5NW5/77

提交回复
热议问题