HTML TABLE WIDTH <table width="...">
The width attribute specifies the width of a table.
If you don't set the width attribute , a table takes up the space it needs to display the table data.
We present below an example to a table with 500 px width:
Example code:
=========================
<table width="500" border="1">
<tr>
<td ><div align="center">Urban Area </div></td>
<td ><div align="center">Population</div></td>
</tr>
<tr>
<td>Philadelphia</td>
<td>5,149,079</td>
</tr>
<tr>
<td>Miami</td>
<td>4,919,036</td>
</tr>
</table>
========================
And the result:
|
Urban Area
|
Population
|
| Philadelphia |
5,149,079 |
| Miami |
4,919,036 |
width in percent (%)
========================
<table width="50%" border="1">
<tr>
<td ><div align="center">Urban Area </div></td>
<td ><div align="center">Population</div></td>
</tr>
<tr>
<td>Philadelphia</td>
<td>5,149,079</td>
</tr>
<tr>
<td>Miami</td>
<td>4,919,036</td>
</tr>
</table>
========================
|
Urban Area
|
Population
|
| Philadelphia |
5,149,079 |
| Miami |
4,919,036 |
===============
<table width="80%" border="1">
<tr>
<td ><div align="center">Urban Area </div></td>
<td ><div align="center">Population</div></td>
</tr>
<tr>
<td>Philadelphia</td>
<td>5,149,079</td>
</tr>
<tr>
<td>Miami</td>
<td>4,919,036</td>
</tr>
</table>
===============
|
Urban Area
|
Population
|
| Philadelphia |
5,149,079 |
| Miami |
4,919,036 |
In the same mode you can to set the width of a cell using the next format:
<td width="500"> or <td width="50%">
|