<td width="" height="">
Browser |
|
---|---|
Type |
The width and height attributes of the TD (TH) element specifies the width and height of a cell.
<td width="200" height="100"></td>
Attribute | Value | Explanation |
---|---|---|
width=" " | pixels or % | the size of the width |
height=" " | pixels or % | the size of the height |
The use of these attributes is deprecated. (Use CSS instead)
Example
<table border="1">
<tr>
<td width="150">150px</td>
<td width="200">200px</td>
<td width="250">250px</td>
</tr>
</table>
- Output
-
150px 200px 250px
<table border="1">
<tr>
<td width="150" height="100">150px * 100px</td>
<td width="200">200px * 100px</td>
<td width="250">250px * 100px</td>
</tr>
</table>
- Output
-
150px * 100px 200px * 100px 250px * 100px
<table border="1" width="100%" height="200">
<tr>
<td width="30%" height="30%">30% * 30%</td>
<td width="70%">70% * 30%</td>
</tr>
<tr>
<td height="70%">30% * 70%</td>
<td>70% * 70%</td>
</tr>
</table>
- Output
-
30% * 30% 70% * 30% 30% * 70% 70% * 70%