Código HTML
<div> <table> <tr> <th>Mamíferos</th> <th>Reptiles</th> <th>Insectos</th> </tr> <tr> <td>Vaca</td> <td>Salamandra</td> <td>Mariposa</td> </tr> <tr> <td>Caballo</td> <td>Serpiente</td> <td>Escarabajo</td> </tr> <tr> <td>Ballena</td> <td>Cocodrilo</td> <td>Polilla</td> </tr> </table>
Código CSS
table, th, tr, td { margin: auto; padding: 6px 10px; text-align: left; border: 2px solid black; border-collapse: collapse; } tr { background-color: #ffecc72d; } th { text-align: center; background-color: blue; color: white; } tr:nth-child(even) {background-color: rgba(20,120,230,0.1);}
RUN
IA
Vista Previa