HTML table needs spacing between columns, not rows

后端 未结 5 1826
南旧
南旧 2021-02-06 20:10

I have an HTML table. I need to have spacing between the table columns, but not the table rows.

If I use the cellspacing CSS property it does it between bot

5条回答
  •  别跟我提以往
    2021-02-06 20:57

    In most cases it could be better to pad the columns only on the right so just the spacing between the columns gets padded, and the first column is still aligned with the table.

    CSS:

    .padding-table-columns td
    {
        padding:0 5px 0 0; /* Only right padding*/
    }
    

    HTML:

    Cell one Cell two

提交回复
热议问题