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
https://forums.phpfreaks.com/topic/200199-buttons-into-one-table-cell/
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?

P.S.

 

This is the stlye the button takes from the .css:

#button-submit_2 {
cursor:pointer;
width:100px;
color:#666666;
text-align: center;
font-size: small;
padding: 0px;
height: 20px;
vertical-align: middle;
background-color: #CCCCCC;
    }

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.