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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:58:31+00:00 2026-05-28T06:58:31+00:00

I have a php code below where it is suppose to display my buttons,

  • 0

I have a php code below where it is suppose to display my buttons, 7 buttons in a row. Now these buttons are displayed in a block which fades in and out. But problem is that the first 7 buttons are not displayed in the block but displayed seperatly and the other buttons are displayed in the block. Why is this happening:

Below is php code:

<table class="optionTypeTbl">
<tr>

        <?php
    $i = 1;
    foreach($num as $key => $val){
        echo"<input type=\"button\" value=\"$val\" id=\"btn".$val."\" name=\"btn".$val."Name\" class=\"gridBtns gridBtnsOff\">";        
        if($i%7 == 0) echo"</td></tr><tr><td>";
        $i++;
    }
?>

        </tr>
        <tr>
        <td>
        <input class="gridBtns" name="btnTrueorFalseName"  id="btnTrueorFalse"  type="button"  value="True or False"  />
        <input class="gridBtns" name="btnYesorNoName"  id="btnYesorNo"  type="button"  value="Yes or No"  />
        </td>
        </tr> 
        </table>

Css:

.gridBtns{
    background-color: #ffffff;
    border: #666666 1px solid;
    color: black;
    font-weight:bold;
    }

.optionTypeTbl{
    display:none;   
    background-color:white;
    position:absolute;  
    border:1px solid black;
}
  • 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-05-28T06:58:31+00:00Added an answer on May 28, 2026 at 6:58 am

    This may have something to do with a missing opening <td> before the buttons.

    I would also re-write the loop to ensure that you don’t have empty row at the end if you have 7/14/21/etc. buttons:

    <table class="optionTypeTbl">
        <?php
        $i = 1;
        foreach($num as $key => $val){
            if($i%7 == 1) echo"<tr><td>";
            echo"<input type=\"button\" value=\"$val\" id=\"btn".$val."\" name=\"btn".$val."Name\" class=\"gridBtns gridBtnsOff\">";        
            if($i%7 == 0) echo"</td></tr>";
            $i++;
        }
        ?>
    
    <tr>
        <td>
        <input class="gridBtns" name="btnTrueorFalseName"  id="btnTrueorFalse"  type="button"  value="True or False"  />
        <input class="gridBtns" name="btnYesorNoName"  id="btnYesorNo"  type="button"  value="Yes or No"  />
        </td>
    </tr> 
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the php code below which help me get a photo's thumbnail image
I have a basic PHP question, take the code below for example, let's say
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser
I have this php code, with which I am trying to generate a popup
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have some PHP code which allows me to sort a column into ascending
I have the PHP code below. It is supposed to select up to ten
I have the following php code below... if ($username == 'fredk') { $fname =
I have a PHP installation running 5.3.3 and when I use the code below:
I have this PHP code echo '<a href=# onclick=updateByQuery(\'Layer3\', ' . json_encode($query) . ');>Link

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.