Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/270975-help-with-table-percent/
Share on other sites

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 by rjmcintyre7

<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>

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.