arbitter Posted December 4, 2011 Share Posted December 4, 2011 Hello there I have this form inside a cell that disfigures the table; it makes it a little higher. Example: <table> <tr><td><form action='bla.php' method='post'><input type='hidden' value='something' name='id' /><input type='submit' name='submit' value='submit' /></form></td></tr> </table> I've been thinking it might be the hidden input field, but the submit button is at the top of the cell so that isn't it... Heres a picture: There's no special markup for the text, and removing the forms makes the cells smaller again, so that isn't it. Anyone any idea? Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/ Share on other sites More sharing options...
jonathonedney Posted December 4, 2011 Share Posted December 4, 2011 arbitter, Consider putting your <form> tags outside of the <table> tags, see how that looks. I've run into this problem before, and that has helped. Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/#findComment-1294306 Share on other sites More sharing options...
haku Posted December 6, 2011 Share Posted December 6, 2011 An entire form won't be tabular data anyways, so you shouldn't be embedding it in a table. Tables should be used for tabular data. Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/#findComment-1294796 Share on other sites More sharing options...
arbitter Posted December 8, 2011 Author Share Posted December 8, 2011 Well the thing is that the rest of the table is also kind of a form... Also, the two buttons are for different functions, so they must have different forms.. And there is a total form around the table as well :/ Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/#findComment-1295692 Share on other sites More sharing options...
haku Posted December 10, 2011 Share Posted December 10, 2011 That sounds like you are embedding forms within forms - another no-no! Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/#findComment-1296475 Share on other sites More sharing options...
arbitter Posted December 10, 2011 Author Share Posted December 10, 2011 Well I'm self-taught so... How should I display data then? I always display it in a table... And then to easily delete and edit certain entries, I have the button at the end of the entry that has a form on its own with the id of that entry. If you hit edit, the same row in the table gets a whole form with input fields instead of just text. I'm not using forms inside forms though. It's like this: For a row with plain text: You have all the plain text in the table. Only the last two cells each include a form with hidden an id and then a button to submit. For the row with editable inputs: You have a form at the beginning of your <tr>. The form stretches along to the first 'edit' button, with in each cell a input field. The last cell still contains a delete button with its own form. Quote Link to comment https://forums.phpfreaks.com/topic/252446-form-disfiguring-table/#findComment-1296497 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.