Chen ri-zhao
4
Q:

table css border

table, th, td {
  border: 1px solid black;
}
7

    <table>

       
      <tr>

         
      <th>Month</th>

         
      <th>Savings</th>

       
      </tr>

       
      <tr>

         
      <td>January</td>

         
      <td>$100</td>

       
      </tr>

      </table>
 
11

#customers td, #customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}

#customers tr:hover {background-color: #ddd;}

#customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #4CAF50;
  color: white;
}
0

<table style="width:100%">
 
<tr>
    <th>Firstname</th>

    <th>Lastname</th> 
    <th>Age</th>

 
</tr>
 
<tr>
    <td>Jill</td>

    <td>Smith</td> 
    <td>50</td>

 
</tr>
  <tr>
    <td>Eve</td>

    <td>Jackson</td> 
    <td>94</td>

  </tr>
</table>
 
0

New to Communities?

Join the community