how to break a line or space in between two rows of the html table

前端 未结 7 1435
长情又很酷
长情又很酷 2021-01-18 06:38

I need to give space or break between two rows, so that my page will looks good.

if you look my code i had given many empty rows and column to make a space between t

7条回答
  •  梦毁少年i
    2021-01-18 06:49

    According to the CSS box model:

    margin values do not apply to table rows and table cells
    See: http://www.w3.org/TR/CSS2/box.html#margin-properties

    padding and border values do not apply to table rows but apply to table cells
    See: http://www.w3.org/TR/CSS2/box.html#padding-properties

    A quick fix is to add padding to the top of the row that you want to separate.

    For example: http://jsfiddle.net/audetwebdesign/caXsZ/

    Sample HTML:

    Row One - 1 Row One - 2
    Row Two - 1 Row Two - 2

    CSS:

    td {
        border: 1px dotted blue;
    }
    tr.row2 td {
        padding-top: 40px;
    }
    

    If you want to style borders around your table cells, you may need to add wrappers around the content and apply borders depending on the design details.

提交回复
热议问题