How do you specify table padding in CSS? ( table, not cell padding )

前端 未结 12 1352
我在风中等你
我在风中等你 2020-12-15 02:18

I have a table with a colored background and I need to specify the padding between the table and it\'s content, I.E. cells.
The table tag doesn\'t seem to accept a paddi

12条回答
  •  一个人的身影
    2020-12-15 03:06

    There is another trick :

    /* Padding on the sides of the table */
    table th:first-child, .list td:first-child { padding-left: 28px; }
    table th:last-child, .list td:last-child { padding-right: 28px; }
    

    (Just saw it at my current job)

提交回复
热议问题