Bootstrap forcing table striping

后端 未结 1 1745
星月不相逢
星月不相逢 2021-01-26 03:42

I have a table inside of a table. On the outer table I want striping and borders, but on the inner one I don\'t. I did this.

相关标签:
1条回答
  • 2021-01-26 04:00

    According to the Bootstrap docs...

    "All table styles are inherited in Bootstrap 4, meaning any nested tables will be styled in the same manner as the parent."

    So in order to override the stripes on the nested table you'd have to add a little CSS...

    .table-nostriped tbody tr:nth-of-type(odd) {
      background-color:transparent;
    }
    
    <table class="table table-bordered table-sm table-striped">
        <tbody>
            <tr>
                <td>
                    <table class="table table-sm table-borderless table-nostriped">
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    

    https://www.codeply.com/go/95b4ecfFP7

    0 讨论(0)
提交回复
热议问题