CSS: borders between table columns only

前端 未结 10 1588
有刺的猬
有刺的猬 2020-12-07 20:11

Is there a way, using CSS, to show borders in a table between columns only (not on the outer edges)?

10条回答
  •  眼角桃花
    2020-12-07 20:39

    Take a table with class name column-bordered-table then add this below css.This will work with bootstrap table too

    .column-bordered-table thead td {
        border-left: 1px solid #c3c3c3;
        border-right: 1px solid #c3c3c3;
    }
    
    .column-bordered-table td {
        border-left: 1px solid #c3c3c3;
        border-right: 1px solid #c3c3c3;
    }
    
    .column-bordered-table tfoot tr {
        border-top: 1px solid #c3c3c3;
        border-bottom: 1px solid #c3c3c3;
    }
    

    see the output below
    N:B You have to add table header backgorund color as per you requirement

提交回复
热议问题