Horje
How to create HTML Table Combine Vertical and Horizontal Zebra Stripes | HTML Table Styling Code
How to create HTML Table Combine Vertical and Horizontal Zebra Stripes

You can combine the styling from the two examples above and you will have stripes on every other row and every other column.

If you use a transparent color you will get an overlapping effect.


Full Example of Combine Vertical and Horizontal Zebra Stripes

Use an rgba() color to specify the transparency of the color:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}

tr:nth-child(even) {
  background-color: rgba(150, 212, 212, 0.4);
}

th:nth-child(even),td:nth-child(even) {
  background-color: rgba(150, 212, 212, 0.4);
}
</style>
</head>
<body>

<h2>Striped Table</h2>
<p>For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or odd) table rows:</p>

<table style="width:100%">
  <tr>
    <th>MON</th>
    <th>TUE</th>
    <th>WED</th>
    <th>THU</th>
    <th>FRI</th>
    <th>SAT</th>
    <th>SUN</th>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
</table>

</body>
</html>

Output should be:

Full Example of Combine Vertical and Horizontal Zebra Stripes



Read Full::
HTML Table Styling Code
Category:
HTML Code
Sub Category:
HTML Table Styling Code
Uploaded:
10 months ago
Uploaded by:
Admin
Views:
1

Related Articles
What is HTML Table Styling HTML Table Styling Code
How to create HTML Table - Zebra Stripes HTML Table Styling Code
How to create HTML Table - Vertical Zebra Stripes HTML Table Styling Code
How to create HTML Table Combine Vertical and Horizontal Zebra Stripes HTML Table Styling Code
How to create HTML Table Horizontal Dividers HTML Table Styling Code
How to create HTML Hoverable Table HTML Table Styling Code

Single Articles
Full Example of Combine Vertical and Horizontal Zebra Stripes

Share on: