Warptweet Posted August 6, 2007 Share Posted August 6, 2007 How can I force all of my tables cells to be a certain width? Here is my code... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text-html; charset=utf-8" /> <link href="style.css" rel="stylesheet" type="text/css" /> <title>Home - Warptweet.com</title> </head> <body bgcolor="#F1F1F1"> <table border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"> <tr> <td colspan="2" height="115" valign="top" bgcolor="6CAF2F"><img src="images/fpheader.jpg" alt="Warptweet.com" /><br /> <font size="4"><a href="?cmd=index">Home</a> <a href="?cmd=flashportal">Flash Portal</a> <a href="?cmd=contact">Contact Us</a> <a href="?cmd=submit">Submit Content</a></font> </td> </tr> <tr> <td bgcolor="#FFFFFF" width="550" valign="top"></td> <td bgcolor="#B2D95E" height="500" valign="top" width="125" style="border-collapse: collapse; table-layout: fixed;">Navigation bar goes here navigation bar goes here<br /><br /> </td> </tr> </table> </body> </html> Whenever I put text in my cells, it stretches to whatever it pleases. How can I absolutely FORCE the tables cells to be a certain size right down to the specified pixel? Quote Link to comment https://forums.phpfreaks.com/topic/63488-solved-force-table-cells-width/ Share on other sites More sharing options...
ToonMariner Posted August 6, 2007 Share Posted August 6, 2007 forcing widths requires you to not force the height. these things should be done in css and not using deprecated html attributes (don't use <td width="" height="">) in css... td {width: 200px;} Quote Link to comment https://forums.phpfreaks.com/topic/63488-solved-force-table-cells-width/#findComment-316566 Share on other sites More sharing options...
Warptweet Posted August 11, 2007 Author Share Posted August 11, 2007 Sorry, but I tried lots of different method with what you told me, but none of them worked. Can somebody edit my code for me? I'd really appreciate it. I've tried at least 20 times editing my code, my columns never, ever seem to stick to it's specified width. Quote Link to comment https://forums.phpfreaks.com/topic/63488-solved-force-table-cells-width/#findComment-320951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.