How can make a div in bottom of td of table in html?
<table style="width:100px;" >
<thead class="text-center">
<th>Name</th>
<th>Marks</th>
</thead>
<tbody>
<tr>
<td>Nikhil</td>
<td>60<br>Average</td>
</tr>
<tr>
<td>Akhil</td>
<td>90<br>Excellent</td>
</tr>
<tr>
<td>Alan</td>
<td>40<br>Poor</td>
</tr>
</tbody>
</table>
For reference i have attached image.
TIA
2
Answers
Update
Semantically, I do not recommend mixing two values in one cell. However, you can embed your two values using the span tag on which you simply apply the
display:block
property. Then you apply thevertical-align:top
property on bothtd
.You don’t need a div, you could just use a tfoot, which is used to define a set of rows summarizing the columns of the table:
In addition, you could also expand the average row with the colspan attribute: