HTML CSS examples for CSS Widget:Table Column
Add background color to parent table th only
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> table {<!--from w ww . j a va 2 s. c om--> border-collapse:collapse } td.gap { padding:6px } table th { background-color:Chartreuse; } table td.gap tr th { background:none; } </style> </head> <body> <table border="1"> <tbody> <tr> <th>Tab1</th> <th>Tab1</th> <th>Tab1</th> <th>Tab1</th> <th>Tab1</th> </tr> <tr> <td colspan="5" class="gap"> <table border="1"> <tbody> <tr> <th>Head 1</th> <th>Head 2</th> <th>Head 3</th> <th>Head 4</th> </tr> <tr> <td>text</td> <td>text</td> <td>text</td> <td>text</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html>