Set cellpadding and cellspacing in CSS?

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

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

28条回答
  •  清酒与你
    2020-11-22 02:32

    From what I understand from the W3C classifications is that

s are meant for displaying data 'only'.

Based on that I found it a lot easier to create a

with the backgrounds and all that and have a table with data floating over it using position: absolute; and background: transparent;...

It works on Chrome, Internet Explorer (6 and later) and Mozilla Firefox (2 and later).

Margins are used (or meant anyways) to create a spacer between container elements, like

,
and
, not
,
, or . Using it for anything other than container elements will keep you busy adjusting your website for future browser updates.

提交回复
热议问题