CSS Cell Margin

后端 未结 16 1278
长情又很酷
长情又很酷 2020-11-29 02:18

In my HTML document, I have a table with two columns and multiple rows. How can I increase the space in between the first and second column with css? I\'ve tried applying \"

16条回答
  •  感情败类
    2020-11-29 03:14

    I realize this is quite belated, but for the record, you can also use CSS selectors to do this (eliminating the need for inline styles.) This CSS applies padding to the first column of every row:

    table > tr > td:first-child { padding-right:10px }
    

    And this would be your HTML, sans CSS!:

    datamore data

    This allows for much more elegant markup, especially in cases where you need to do lots of specific formatting with CSS.

提交回复
热议问题