Jump to content

Set a table columns width


Rain Lover

Recommended Posts

Hi, I tried to do it by adjusting the <td> width:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Sample Page</title><style type="text/css">div {width:100%; overflow:auto;}table, td {border:1px solid #000;}td {width:1000px;}</style></head><body><div><table><tr><td>First cell</td><td>Second cell</td><td>Third cell</td></tr><tr><td>Forth cell</td><td>Fifth cell</td><td>Sixth cell</td></tr></table></div></body></html>

But it didn't work. Many thanks for any help!Mike

Link to comment
Share on other sites

Hello Mike ,you can try add a class to each td. Just like this:

<tr><td class="class_td">First cell</td><td class="class_td">Second cell</td><td class="class_td">Third cell</td></tr><tr><td class="class_td">Forth cell</td><td class="class_td">Fifth cell</td><td class="class_td">Sixth cell</td></tr>

And include inside <style></style> this line:

.class_td{width:1000px;}

Regards, Daniel

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...