CSS table layout: why does table-row not accept a margin?

后端 未结 10 2363
余生分开走
余生分开走 2020-12-12 23:34



        
10条回答
  •  青春惊慌失措
    2020-12-13 00:02

    How's this for a work around (using an actual table)?

    table {
        border-collapse: collapse;
    }
    
    tr.row {
        border-bottom: solid white 30px; /* change "white" to your background color */
    }
    

    It's not as dynamic, since you have to explicitly set the color of the border (unless there's a way around that too), but this is something I'm experimenting with on a project of my own.

    Edit to include comments regarding transparent:

    tr.row {
        border-bottom: 30px solid transparent;
    }
    

提交回复
热议问题