2016-08-11 66 views
-1

我在tr的內部插入邊框但不應用邊框。 我的代碼在表TR的TR內部添加邊框頂部

<tr class="shipping"> 
<th>Shipping 2</th> 
<td data-title="Shipping 2"> 
       <p>There are no shipping methods available. Please check your address or contact us if you need any help.</p> 

       <p class="woocommerce-shipping-contents"><small>Military Grade Paracord Kit ×1</small></p>  
     </td> 

和css是

tr { 
    border-top: 9px solid red; 
    } 
+2

的[添加邊框底部錶行]可能的複製(http://stackoverflow.com/questions/10040842/add-border-bottom-to-table-排-TR) – yuriy636

回答

0

,如果你想設置一個tr元素的邊界應設置表的border-collapsecollapse

table { 
 
    border-collapse: collapse 
 
} 
 
tr { 
 
    border-top: 9px solid red; 
 
}
<table> 
 
    <tr class="shipping"> 
 
    <th>Shipping 2</th> 
 
    <td data-title="Shipping 2"> 
 
     <p>There are no shipping methods available. Please check your address or contact us if you need any help.</p> 
 
     <p class="woocommerce-shipping-contents"><small>Military Grade Paracord Kit ×1</small></p>  
 
    </td> 
 
    </tr> 
 
</table>

0

你可以試試這個:

tr > th { 
    border-top: 9px solid red; 
}