Set cellpadding and cellspacing in CSS?

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

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

28条回答
  •  轮回少年
    2020-11-22 02:35

    Wrap the contents of the cell with a div and you can do anything you want, but you have to wrap every cell in a column to get a uniform effect. For example, to just get wider left & right margins:

    So the CSS will be,

    div.cellwidener {
      margin: 0px 15px 0px 15px;
    }
    td.tight {
      padding: 0px;
    }
My content

Yes, it's a hassle. Yes, it works with Internet Explorer. In fact, I've only tested this with Internet Explorer, because that's all we're allowed to use at work.

提交回复
热议问题