I copied the table code from Bootstrap and set each of the rows to have its own background color, but there is white space in between each 1 and I do not know why.
I set all the border, margins and paddings to 0 for all the "tr"s, "tbody" and the "thead."
Question: What can I do in order to prevent the white spaces appearing around table cells?
#C1{
margin-top: 40px;
width: 75%;
border: 1px solid black;
padding: 0px;
}
.table-red{
background-color: red;
color: #ffffff
}
.table{
margin-bottom: 0px;
padding: 0px;
}
.table-striped tbody tr:nth-of-type(even){
background-color: red;
color: white;
}
.table-striped tbody tr:nth-of-type(odd){
background-color: blue;
color: white;
border: 0;
}
thead{
background-color: green;
border: 0px;
margin-bottom: 0px;
margin-top: 0px;
}
th{
border: 0px;
}
tbody{
margin-top: 0px;
}
<div class="container" id="C1">
<table class="table table-striped">
<thead >
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
The white space should disappear