Resize height of a cell in a table.
<table>
<tr>
<th style="border: 1px solid black; border-color: #96D4D4; height:5px">Amount1</th>
<td style="border: 1px solid black; border-color: #96D4D4;">50</td>
</tr>
<tr>
<th style="border: 1px solid black; border-color: #96D4D4; height:5px">Amount2</th>
<td style="border: 1px solid black; border-color: #96D4D4;">50</td>
</tr>
<tr>
<th style="border: 1px solid black; border-color: #96D4D4; height:5px">Total</th>
<td style="border: 1px solid black; border-color: #96D4D4;">100</td>
</tr>
</table>
The result is,
I want the size of the cell border to be reduced less than 10px, though height is provided as 5px, it is not reducing the sized. Any suggestion would be appreciated
2
Answers
The
<div>
element is used to wrap the content inside each<th>
(table header) cell. Theheight: 5px;
style applied to the<div>
sets the height of the header cell to 5 pixels.This approach provides a way to control the height of specific cells in the table while allowing for additional styling flexibility.
You can reduce height of the last row putting
style="line-height: 5px;"
at that level, like:Or if you want to reduce height of all rows, the same may be put at
table
level.