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:


Regards, Daniel

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...