Tolgar
asked on
How to limit the width of a column and left align in HTML?
I have the following table in HTML.
The width of each column changes with the content of the longest cell.
How can I make the column width fixed and left align each cell?
The width of each column changes with the content of the longest cell.
How can I make the column width fixed and left align each cell?
<html>
<table>
<p>
<table border="1">
<thead align="center" style="padding:8px" bgcolor="#FFEFD5">
<tr bgcolor="lightyellow">
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</thead>
<tbody>
<th rowspan="2">a</th>
<td>b</td><td>d</td></tr>
<td>c</td><td>e</td></tr>
</tbody>
</table>
</html>
ASKER
Could you please insert it into my code?
Thanks,
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. But this changes all column widths.
Is it possible to change only the first and the second column widths?
Thanks,
Is it possible to change only the first and the second column widths?
Thanks,
ASKER
ok. I got it.
I put the width inside td tags.
Thanks,
I put the width inside td tags.
Thanks,
width:100px
}
th,td {
text-align:left
}