Set cellpadding and cellspacing in CSS?

前端 未结 28 1087
暖寄归人
暖寄归人 2020-11-22 02:15

In an HTML table, the cellpadding and cellspacing can be set like this:

28条回答
  •  伪装坚强ぢ
    2020-11-22 02:18

    td {
        padding: npx; /* For cellpadding */
        margin: npx; /* For cellspacing */
        border-collapse: collapse; /* For showing borders in a better shape. */
    }
    

    If margin didn't work, try to set display of tr to block and then margin will work.

提交回复
热议问题