CSS horizontal table cell spacing: how?

后端 未结 9 2079
悲哀的现实
悲哀的现实 2021-02-03 19:12

Hopefully this is an easy one but I have not found a solution. I want to put space between columns on a table.

Example

| Cell |<- space ->| Cell |         


        
9条回答
  •  余生分开走
    2021-02-03 19:56

    try using cols

    example

    cols also support classes :)

    hope this helps

    Darko

    EDIT: To clarify a col is an element declared at the top of the table to influence entire columns. The first col element will influence the first column, the second col = second column and so on. They can be grouped in colgroups if you wish to assign the same style to more than one column.

    EDIT2: After some more research it turns out that the only reliable styles you can set on a col element are:

    • border
    • background
    • width
    • visibility

    No margin or padding. Bugger! Would setting the width of the columns explicitly solve your problem?

提交回复
热议问题