简体   繁体   中英

Style a table row with background color and border radius

I have a table row with 2 columns, and I would like to put a background color with a border radius.

 <table> <tfoot> <tr> <td class="d-inline-block ltr font-14 font-weight-bold"> Price:</td> <td class="text-right text-primary"> 1600$ </td> </tr> </tfoot> </table>

在此处输入图像描述

without encountering this problem by giving the background color only to tds

在此处输入图像描述

 tr td:first-child { border-top-left-radius: 150px; border-bottom-left-radius: 150px; } tr td:last-child { border-top-right-radius: 150px; border-bottom-right-radius: 150px; } td { padding: 12px; background-color: yellow; border: solid 0px #000; } table { border-collapse: collapse; }
 <table> <tfoot> <tr> <td class="d-inline-block ltr font-14 font-weight-bold"> Price: </td> <td class="text-right text-primary"> 1600$ </td> </tr> </tfoot> </table>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM