Cannot put margin on tag with neither CSS nor cellspacing attribute

后端 未结 7 1821
感情败类
感情败类 2020-12-13 09:39

For whatever reason, I have been unable to get any table cells to have margin between them. I want the table cells to have a grey background colour (over a white page backgr

7条回答
  •  無奈伤痛
    2020-12-13 09:43

    If someone still has this problem, try this in your CSS stylesheet:

    table {
      border-collapse: separate;
      border-spacing: 10px 5px;
    }
    

    The values for border-spacing are two length measurements. The horizontal value comes first and applies between columns. The second measurement is applied between rows.

    If you provide one value, it will be used both horizontally and vertically. The default setting is 0, causing the borders to double up on the inside grid of the table.

提交回复
热议问题