Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- <style id="jsbin-css">
- .col1 {
- background-color: lightblue;
- }
- .col2 {
- background-color: lightgreen;
- }
- table {
- border-style: solid;
- border-collapse: initial;
- width: 100%;
- text-align: center;
- }
- tbody > tr:nth-child(even){
- background-color: white
- }
- tbody > tr:nth-child(odd){
- background-color: red
- }
- tr:hover {
- background-color: #ccff99;
- }
- </style>
- </head>
- <body>
- <table>
- <colgroup>
- <col span="2" class="col1">
- <col span="1" class="col2">
- </colgroup>
- <thead>
- <tr>
- <th>Name</th>
- <th>Email</th>
- <th>Address</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Bob</td>
- <td>alex@gmail.com</td>
- <td>Alex Address</td>
- </tr>
- <tr>
- <td>Alex</td>
- <td>alex@gmail.com</td>
- <td>Alex Address</td>
- </tr>
- <tr>
- <td>William</td>
- <td>william@gmail.com</td>
- <td>William Address</td>
- </tr>
- <tr>
- <td>Alexa</td>
- <td>alexa@gmail.com</td>
- <td>Alexa Address</td>
- </tr>
- </tbody>
- </table>
- <script id="jsbin-source-css" type="text/css">.col1 {
- background-color: lightblue;
- }
- .col2 {
- background-color: lightgreen;
- }
- table {
- border-style: solid;
- border-collapse: initial;
- width: 100%;
- text-align: center;
- }
- tbody > tr:nth-child(even){
- background-color: white
- }
- tbody > tr:nth-child(odd){
- background-color: red
- }
- tr:hover {
- background-color: #ccff99;
- }</script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment