novice
139
Q:

html tabellen


table, th, td
{

  border: 1px solid black;

} 
-1

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

   
 border-collapse: collapse;
} 
0

<table style="width:100%">
  <tr>
    <th>Name:</th>
    <td>Bill Gates</td>
  </tr>
  
<tr>
    <th rowspan="2">Telephone:</th>
    
<td>55577854</td>
  </tr>
  <tr>
    
<td>55577855</td>
  </tr>
</table> 
0

<table style="width:100%">
  <tr>

    <th>Name</th>

    
<th colspan="2">Telephone</th>
  </tr>

  <tr>
    
<td>Bill Gates</td>
    <td>55577854</td>
    
<td>55577855</td>
  </tr>
</table> 
0

  #t01 tr:nth-child(even) {

  background-color: #eee;
}

  #t01 tr:nth-child(odd) {

  background-color: #fff;
}

  #t01 th {
  color: white;
  background-color: black;
}
 
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

 table {
  border-spacing: 5px;
} 
0

  #t01 {
  width: 100%; 

  background-color: #f1f1c1;
}
 
0

 th {
  text-align: left;
}
 
0

<table id="t01">

  <tr>
    <th>Firstname</th>

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

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

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

  </tr>
</table>
 
0

New to Communities?

Join the community