HTML Table: Specifying the width of a column

This entry is part 7 of 16 in the series HTML Table

Say we have a table where the first column is a running number and in the example below, an ID, which is a running number.

We would have known that we need a smaller column for this ID.

So the ID column is set at 10%,  the Artiste and Album at 45%.

<!DOCTYPE html>
<html>
<head lang='en'>     
    <meta charset='UTF-8'>
    <title>Codecrawl.com-HTML Table</title>
</head>
<body>

<table border='1' width='100%'>
    <tr>
        <th width='10%'>ID</th>
        <th width='45%'>Artiste</th>
        <th width='45%'>Album</th>
    </tr>
    <tr>
        <td>1</td>
        <td>Rod Stewart</td>
        <td>Maggie May</td>
    </tr>
</table>

</body>
</html>


Width of a column

Series Navigation<< HTML Table: Setting table height
HTML Table: Spanning or merging table cells >>