kalster Posted November 21, 2012 Share Posted November 21, 2012 I have a problem of course . the table width is not displayed correctly. The collumes (i think i said that correctly) is not displaying at 20%. the width of the table is not displaying correctly. at the last input, the width is not the same as the other width. i hope your understand. thank you. the table is displayed, but the last feild is not at the 20% like the rest. <table width="100%" border="1"> <form action="event.php" method="post" name="event" id="event"> <tr> <td width="%20">Crime</td> <td width="%20">Money</td> <td width="%20">Chance</td> <td width="%20">Burglar men</td> <td width="%20"><input type="submit" value="submit"></td> </tr> </form> </table> Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/ Share on other sites More sharing options...
rjmcintyre7 Posted November 21, 2012 Share Posted November 21, 2012 (edited) When you run into issues like this, try going to: http://validator.w3.org/check to see if your code is valid before posting here. I placed your code into the validator (with the doctype reference and full html tags) and received a few errors that may or may not be causing your issue. Here is the snippet that passed validation: <form action="event.php" method="post" name="event" id="event"> <table width="100%" border="1"> <tr> <td width="%20">Crime</td> <td width="%20">Money</td> <td width="%20">Chance</td> <td width="%20">Burglar men</td> <td width="%20"><input type="submit" value="submit" /></td> </tr> </table> </form> Your form tag should be outside of your table AND you should have a closing "/" on your input. See if that takes care of your layout issue. And while it isn't a validation issue, you should choose to put the "%" consistently before or after the number to make it easier to view for others - after the number is most widely accepted, but either way, try not to go back and forth like in this example (i.e. 100% and %20). Edited November 21, 2012 by rjmcintyre7 Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394185 Share on other sites More sharing options...
Love2c0de Posted November 24, 2012 Share Posted November 24, 2012 (edited) When I changed your <td width="20%">, all the table data's seem to now have the same width. Was never aware '%20' was allowed. Regards, AoTB. Edited November 24, 2012 by AoTBuNgLe Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394830 Share on other sites More sharing options...
Jessica Posted November 24, 2012 Share Posted November 24, 2012 It would seem its not Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394833 Share on other sites More sharing options...
smallc28 Posted November 25, 2012 Share Posted November 25, 2012 <table width="100%" border="1"> <form action="event.php" method="post" name="event" id="event"> <tr> <td width="20%">Crime</td> <td width="20%">Money</td> <td width="20%">Chance</td> <td width="20%">Burglar men</td> <td width="20%"><input type="submit" value="submit"></td> </tr> </form> </table> Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394910 Share on other sites More sharing options...
smallc28 Posted November 25, 2012 Share Posted November 25, 2012 My guest is to make submit button width "smaller since its a small button <table width="96%" border="1"> <form action="event.php" method="post" name="event" id="event"> <tr> <td width="20%">Crime</td> <td width="20%">Money</td> <td width="20%">Chance</td> <td width="31%">Burglar men</td> <td width="9%"><input type="submit" value="submit"></td> </tr> </form> </table> Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394911 Share on other sites More sharing options...
MDCode Posted November 25, 2012 Share Posted November 25, 2012 You are setting your table width to 96% yet it adds up to 100% Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1394964 Share on other sites More sharing options...
codefossa Posted November 26, 2012 Share Posted November 26, 2012 You are setting your table width to 96% yet it adds up to 100% Say the table at 96% was 1000px wide. If you set a TD to 20%, it will be 20% of that 96% or 1000px which is a TD with a width of 200px. Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1395068 Share on other sites More sharing options...
kalster Posted November 26, 2012 Author Share Posted November 26, 2012 thank you. i fixed the table width by changing %20 to 20%. this topic is solved. Quote Link to comment https://forums.phpfreaks.com/topic/270975-help-with-table-percent/#findComment-1395326 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.