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 9170691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:03:40+00:00 2026-06-17T16:03:40+00:00

I am having an issue with an options and answers feature I have. If

  • 0

I am having an issue with an options and answers feature I have. If I select an options which contains an output of some many buttons e.g If I choose option 20, it will display 20 buttons, the problem I am getting i my content drops down a little bit as it creates a space when the table cell increases. My question is simply how can I keep the content aligned near enough the top and not move down if the table cell increases a bit?

Screenshot of what it looks like:

enter image description here

Below is what I attempted but did not work:

.option{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
}

.noofanswer{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
}

.answer{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
}

Below is the tables:

var $options = $("<table class='option'><tbody><tr><td>1. Option Type:</td></tr></tbody></table>");
var $noofanswers = $("<table class='noofanswers'><tbody><tr><td>2. Number of Answers:</td></tr></tbody></table>");
var $answer = $("<table class='answer'><tbody><tr><td>3. Answer:</td></tr></tbody></table>");

UPDATE:

 var $options = $("<table class='option'><tbody><tr><td class='opt'>1. Option Type:</td></tr></tbody></table>");
    var $noofanswers = $("<table class='noofanswers'><tbody><tr><td class='noofans'>2. Number of Answers:</td></tr></tbody></table>");
    var $answer = $("<table class='answer'><tbody><tr><td class='ans'>3. Answer:</td></tr></tbody></table>");


    var $this, i=0, $row, $cell;
    $('#optionAndAnswer .answers').each(function() {
        $this = $(this);
        if(i%6 == 0) {
            $row = $("<tr/>").appendTo($answer);
            $cell = $("<td/>").appendTo($row);
        }
        var $newBtn = $(("<input class='answerBtnsRow answers' type='button' style='display:%s;' onclick='btnclick(this, " + gQuestionIndex + ");' />").replace('%s', $this.is(':visible') ? 'inline-block' : 'none')).attr('name', "value[" + gQuestionIndex + "][]").attr('value', $this.val()).attr('class', $this.attr('class')).attr('id', $this.attr('id') + 'Row');
        $newBtn.appendTo($cell);

        i++;
    });

CSS:

td.opt{
    vertical-align:top;
    padding-top:1em;
}

td.noofans{
    vertical-align:top;
}

td.ans{
    vertical-align:top;
    padding-bottom:1em;

}

.option{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
    border-collapse: collapse;
    margin:0;
}

.noofanswer{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
    border-collapse: collapse;
    margin:0;
}

.answer{
    width:100%;
    text-align:center;
    padding-top:1em;
    padding-bottom:1em;
    padding-left:0;
    padding-right:0;
    border-collapse: collapse;
    margin:0;
}
  • 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-17T16:03:41+00:00Added an answer on June 17, 2026 at 4:03 pm

    Try this CSS for <td> elements:

    td {
      vertical-align: top;
    }
    

    And here is more specifics. The whole CSS should look like this:

    * {
      margin: 0; padding: 0;
    }
    
    table {
      border-collapse: collapse;
    }
    
    td {
      vertical-align: top;
    }
    
    .option{
        width:100%;
        text-align:center;
        padding-top:1em;
        padding-bottom:1em;
        padding-left:0;
        padding-right:0;
    }
    
    .noofanswer{
        width:100%;
        text-align:center;
        padding-top:1em;
        padding-bottom:1em;
        padding-left:0;
        padding-right:0;
    }
    
    .answer{
        width:100%;
        text-align:center;
        padding-top:1em;
        padding-bottom:1em;
        padding-left:0;
        padding-right:0;
    }
    

    And here is the PHP code with edits to add cellpadding and cellspacing to the <table> tags:

    var $options = $("<table class='option' cellpadding='0' cellspacing='0'><tbody><tr><td>1. Option Type:</td></tr></tbody></table>");
    var $noofanswers = $("<table class='noofanswers' cellpadding='0' cellspacing='0'><tbody><tr><td>2. Number of Answers:</td></tr></tbody></table>");
    var $answer = $("<table class='answer' cellpadding='0' cellspacing='0'><tbody><tr><td>3. Answer:</td></tr></tbody></table>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an issue with an options and answers feature I have. If
Hi guys I am having issue I have this query: SELECT * FROM useraccount
I'm building a menu options, having issue in last option, The Anchor method doesn't
Just started mongo and started having issue with querying already. i have a collection
Having an issue here that I have tried everything I can think of but
I am having an issue compiling my program here are my gcc options used
I'm having an issue I've been fighting for a few hours, and have not
I am having an issue getting a drop down list to choose the right
I am having an issue with Eclipse (Indigo) regarding the order in which my
I'm having an issue with the HTML below: <html> <body> <p style=font-size: large> Some

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.