side by side html button allignment without css

Frank Melan 21 Reputation points
2022-08-13T20:59:39.727+00:00

I am using an application that limits coding to pure html. I am trying to align the buttons on the same line. Currently the code written aligns the buttons left & center, but when I change to the view mode, this is what I see:
230939-image.png

Here is the code: </td><p align="left"><a href="#description2"><button><font size="+2">Cameo - European Crabapples</font></button></a><p align="center"><a href="#description3"><button><font size="+2">EverCrisp - JAZZ™</font></button></a></p></td>

I have searched the web, & every site uses css. Any help is greatly appreciated. This is my first attempt at HTML & I am self taught. So what I am doing is probably not done correctly. Sorry in advance & thank you. If i posted under the wrong tag please advise me, which tag to post under.

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-08-14T04:57:32.237+00:00

    Hi @Frank Melan

    The following code puts the buttons next to one another:

    <div style="display: inline-block;"><button><font size="+2">Cameo - European Crabapples</font></button> <button><font size="+2">EverCrisp - JAZZ™</font></button></div>

    Display:

    230976-image.png

    ----------------------------------------

    If this is helpful please accept answer.


4 additional answers

Sort by: Most helpful
  1. Frank Melan 21 Reputation points
    2022-08-14T11:55:02.31+00:00

    Thank you for replying. I added this piece to your code <a href="#description2">, & it provided a background color to other areas of the page. The sample provided sets the buttons perfectly, but was missing the piece to activate the button. Is there something I am missing?

    I was got this to work, but the buttons are against each other.

    </td><div><div style="float:left"><p align="left"><a href="#description2"><button><font size="+2">Cameo - European Crabapples</font></button></a><p align="left"></div><div><div style="float:center"><a href="#description3"><button><font size="+2">EverCrisp - JAZZ™</font></button></a></p><p align="center"><td></td></div><div style="float:center"></div></td></div>  
    
    0 comments No comments

  2. Frank Melan 21 Reputation points
    2022-08-14T15:45:45.337+00:00

    @Dillon Silzer Sorry I didn't tag you in my last response. I forgot to do so.

    Here is my revised code: <center></td><div><div style="float:left"><p align="left"><a href="#description2"><button><font size="+2">Cameo - European Crabapples</font></button></a><p align="left"></div><div><div style="float:center"><a href="#description3"><button><font size="+2">EverCrisp - JAZZ™</font></button></a></p><p align="center"><td></td></div><div style="float:center"></div></td></div></center> I found that if I added <center> & </center> it worked, but left a gap. If the gap con't be removed & a 3rd div added on the same line, I can live with it. Can you suggest any improvements?


  3. Frank Melan 21 Reputation points
    2022-08-14T15:59:56.07+00:00

    @Dillon Silzer THANK YOU! (apparently we were both posting at the same time) It worked perfectly. previously I tried &nbsp; but apparently just not at the right location. Also it allows me to add a 3rd button, which is exactly what I wanted to do. Again thank you.

    0 comments No comments

  4. Frank Melan 21 Reputation points
    2022-08-15T14:21:37.15+00:00

    Here is working code, for further users:
    <td> <div style="display: inline-block;"><a href="#description2"><button><font size="+2">Cameo - European Crabapples</font></button></a>                   <a href="#description3"><button><font size="+2">EverCrisp - JAZZ™</font></button></a>                    <a href="#description4"><button><font size="+2">Jersey Mac – Liberty </font></button></a></td></div>
    The original author of the code is @Dillon Silzer . He wrote the code & I modified it for my use. The &nbsp; is for spacing between the buttons.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.