Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <head>
- <link rel="stylesheet" type="text/css" href="mycss.css">
- <style>
- table{
- font-size:30px;
- border-collapse: collapse;
- margin:500px auto;
- }
- tbody tr {
- background-color: green;
- }
- td,th{
- border:2px solid black;
- }
- tbody tr:nth-child(3n+1)
- {
- background-color: blue;
- }
- tr:nth-child(4n+2):hover
- {
- background:red ;
- }
- tr:nth-child(4n+2)
- {
- background:white ;
- }
- </style>
- </head>
- <table>
- <thead>
- <tr>
- <td>Head</td>
- <td>Head</td>
- <td>Head</td>
- <td>Head</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>1</td>
- <td>1</td>
- <td>1</td>
- <td>1</td>
- </tr>
- <tr>
- <td>2</td>
- <td>2</td>
- <td>2</td>
- <td>2</td>
- </tr>
- <tr>
- <td>3</td>
- <td>3</td>
- <td>3</td>
- <td>3</td>
- </tr>
- <tr>
- <td>4</td>
- <td>4</td>
- <td>4</td>
- <td>4</td>
- </tr>
- <tr>
- <td>5</td>
- <td>5</td>
- <td>5</td>
- <td>5</td>
- </tr>
- <tr>
- <td>6</td>
- <td>6</td>
- <td>6</td>
- <td>6</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td>footer</td>
- <td>footer</td>
- <td>footer</td>
- <td>footer</td>
- </tr>
- </tfoot>
- </table>
- </body>
- </html>
- ************************************************************************************************************
- <html>
- <head>
- <title>Child Tips</title>
- <style>
- table{
- margin:200px auto;
- }
- tr,td,th {
- font-size:30px;
- border:black solid 1px;
- padding:5px;
- }
- /* tbody tr
- {
- background:red
- } */
- tbody tr:nth-child(3n+1)
- {
- background-color: blue;
- }
- tbody tr:nth-child(2)
- {
- background-color: red;
- }
- tbody tr:nth-child(4n+2)
- {
- background:purple;
- }
- thead tr:hover{
- background:green;
- }
- tfoot tr:hover
- {
- background:orange;
- }
- </style>
- </head>
- <body>
- <table>
- <caption style="font-size:50px">
- Child - Tips
- </caption>
- <thead>
- <tr>
- <th>This is Header1</th>
- <th>This is Header2</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body2</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body2</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body2</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body2</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- <tr>
- <td>This is Table Body1</td>
- <td>This is Table Body1</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td>This is Table foot1</td>
- <td>This is Table foot2</td>
- </tr>
- </tfoot>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement