table-collapse-1.html (1457B)
1 <!DOCTYPE html> 2 <head> 3 <style> 4 html { 5 line-height: 1.25; 6 } 7 body { 8 background-color: white; 9 margin: 0; 10 } 11 table { 12 background-color: red; 13 border-collapse: collapse; 14 } 15 thead { 16 background-color: pink; 17 } 18 tbody { 19 background-color: grey; 20 } 21 tfoot { 22 background-color: orange; 23 } 24 tr { 25 background-color: green; 26 } 27 td:first-child { 28 background-color: cyan; 29 } 30 td { 31 padding: 0; 32 background-color: blue; 33 border-style: solid; 34 border-width: 5px; 35 border-color: gold; 36 } 37 colgroup { 38 background-color: purple; 39 } 40 col:first-child { 41 background-color: khaki; 42 } 43 .rel { 44 position: relative; 45 left: 100px; 46 } 47 </style> 48 </head> 49 <body> 50 <table> 51 <colgroup> 52 <col> 53 <col> 54 </colgroup> 55 <thead class="rel"> 56 <tr> 57 <td class="rel">XXX</td> 58 <td class="rel">YYY</td> 59 </tr> 60 </thead> 61 <tbody class="rel"> 62 <tr> 63 <td class="rel">XXX</td> 64 <td>YYY</td> 65 </tr> 66 <tr> 67 <td>XXX</td> 68 <td rowspan=2 class="rel">YYY</td> 69 </tr> 70 <tr class="rel"> 71 <td class="rel">XXX</td> 72 </tr> 73 <tr> 74 <td colspan=2 class="rel">XXX</td> 75 </tr> 76 </tbody> 77 <tfoot> 78 <tr> 79 <td class="rel">XXX</td> 80 <td>YYY</td> 81 </tr> 82 </tfoot> 83 </table> 84 </body>