Jump to content

Buttons into one table cell


freelance84

Recommended Posts

Hello,

 

I have a problem with tables cells containing form buttons:

 

<tr>
<td colspan="2" align="center">

<button id="button-submit_2" type="submit">Add Name</button>
     </form>

<form action="nrt-home-edit&delete.php" method="post">
<input type="hidden" name="class_name" value="$class_name[0]"/>
<button id="button-submit_2" type="submit">Finish</button></form>

</td>
</tr>

 

The above code puts the two buttons on their own lines within the table cell. My question is, does anybody know how to keep them on the same line without putting them into their own individual cells?

Link to comment
Share on other sites

Hmm, I've just got round to trying to get the two buttons on the same line...

 

I changed my code to

<tr>
<td colspan="2" align="center" nowrap="nowrap">

<button id="button-submit_2" type="submit">Add Name</button></form>
<form action="nrt-home-edit&delete.php" method="post"><input type="hidden" name="class_name" value="$class_name[0]"/>
<button id="button-submit_2" type="submit">Finish</button></form>

</td>
</tr>

 

But the two buttons are still refusing to share the same line and the result is two buttons centred in the td but one on top of the other.

 

Does anyone have any ideas?

Link to comment
Share on other sites

I'm sorry, I just noticed that you have two different forms in your cell. That's the problem. I have seen that, by default, forms have line breaks after them. I've never tried styling them before, but try that. Add "display: inline;" and/or "float: {left or right};" to the styling of the forms.

Link to comment
Share on other sites

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.