Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8502805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:35:15+00:00 2026-06-11T01:35:15+00:00

I am using a table and a div to create a centered button group…but

  • 0

I am using a table and a div to create a centered button group…but for some reason, my buttons are aligned weird? Here is a jsfiddle of the issue. Jsfiddle

Is there any way I can fix this to where I can add more buttons and have them straight?
If more code is required, please ask me and I will post it.

Here is my html:

 <div align = "center" class="bdy">

        <table class="wrapper">

            <tr>

                <td>

                    <button type="button">Services</button>

                    <br>

                    <button type="button">Live</button>

                </td>


            </tr>

        </table>

    </div>​

My CSS is on the fiddle!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:35:16+00:00Added an answer on June 11, 2026 at 1:35 am

    I fixed the alignment by removing the whitespace between buttons, but this is not the right way to do it.

    Fixed version (reference only): http://jsfiddle.net/J7rYF/1/

    Tables shouldn’t be used to layout buttons. div align=center is deprecated. <br> shouldn’t be used for this type of formatting purpose.

    If you want an out of-the-box example/solution, Twitter Bootstrap has some very nice examples and templates.

    Or, here’s a simple template that you can start with for centering a list of buttons: http://jsfiddle.net/J7rYF/10/

    HTML

    <div class="button-set">
        <ul>
            <li><button type="button">Services</button></li>
            <li><button type="button">Live</button></li>
        </ul>
    </div>
    

    CSS

    .button-set {
       width: 300px;
       margin: 0 auto; /* this centers the element */       
    }
    
    .button-set UL {
        list-style: none; /* removes bullets */  
    }
    
    /* this controls spacing between adjacent buttons */
    .button-set LI + LI {   
        margin-top: 4px;
    }
    
    /* width: 100% is needed...everything else is optional */
    BUTTON {
        width: 100%;
        border: 1px solid #000;
        padding: 4px;
        border-radius: 4px;
        color: #fff;
        background-color: #006DCC;
    }
    

    ​

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I am attempting to create a table-like structure using divs on my site but
I'm trying to create a table-less layout using floats, but I'm having trouble getting
I am trying to create a web page using CSS (Table less) but my
I have a 3 column layout using table-less design. <div id=main> <div id=left></div> <div
it is possible to reload a div or a table using location.reload(); ? after
I'm trying to generate a dynamic table using CSS: <html> <head> <style> div.el1, div.el2
I'm attempting to create divs in an table using jQuery. The table represents a
I need to create a large table of contents for an HTML book but
while($row = mysql_fetch_array($result)){ echo '<table><tr><td>' . $row[some] . '</td><td>'. $row[somenae]. '<div>'. $row[some] . '</div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.