Guest User

Untitled

a guest
May 19th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. <style id="jsbin-css">
  8. .col1 {
  9. background-color: lightblue;
  10. }
  11.  
  12. .col2 {
  13. background-color: lightgreen;
  14. }
  15.  
  16. table {
  17. border-style: solid;
  18. border-collapse: initial;
  19. width: 100%;
  20. text-align: center;
  21. }
  22.  
  23. tbody > tr:nth-child(even){
  24. background-color: white
  25. }
  26.  
  27. tbody > tr:nth-child(odd){
  28. background-color: red
  29. }
  30.  
  31. tr:hover {
  32. background-color: #ccff99;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37.  
  38. <table>
  39. <colgroup>
  40. <col span="2" class="col1">
  41. <col span="1" class="col2">
  42. </colgroup>
  43.  
  44. <thead>
  45. <tr>
  46. <th>Name</th>
  47. <th>Email</th>
  48. <th>Address</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr>
  53. <td>Bob</td>
  54. <td>alex@gmail.com</td>
  55. <td>Alex Address</td>
  56. </tr>
  57. <tr>
  58. <td>Alex</td>
  59. <td>alex@gmail.com</td>
  60. <td>Alex Address</td>
  61. </tr>
  62. <tr>
  63. <td>William</td>
  64. <td>william@gmail.com</td>
  65. <td>William Address</td>
  66. </tr>
  67. <tr>
  68. <td>Alexa</td>
  69. <td>alexa@gmail.com</td>
  70. <td>Alexa Address</td>
  71. </tr>
  72. </tbody>
  73. </table>
  74.  
  75.  
  76.  
  77. <script id="jsbin-source-css" type="text/css">.col1 {
  78. background-color: lightblue;
  79. }
  80.  
  81. .col2 {
  82. background-color: lightgreen;
  83. }
  84.  
  85. table {
  86. border-style: solid;
  87. border-collapse: initial;
  88. width: 100%;
  89. text-align: center;
  90. }
  91.  
  92. tbody > tr:nth-child(even){
  93. background-color: white
  94. }
  95.  
  96. tbody > tr:nth-child(odd){
  97. background-color: red
  98. }
  99.  
  100. tr:hover {
  101. background-color: #ccff99;
  102. }</script>
  103. </body>
  104. </html>
Add Comment
Please, Sign In to add comment