Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

Align radio button with text / numbers (answers) horizontally

$
0
0
Dear All,

I have the following code for a quiz: 

</div>
                  <h4 class="quction"  > 
                     <?php echo $q->question;?> 
                  </h4>
                  <table width="100%" border="0" class="answeers">
                     <input type="hidden" name="<?php echo $q->questionid;?>" value="0" id="" checked >
                     <?php 
                        if (isset($q->answer1)) {  
                         ?>
                     <tr>
                        <td>
                           <input type="radio" name="<?php echo $q->questionid;?>" value="1" id=""><?php echo $q->answer1;?>
                        </td>
                     </tr>
                     <?php } ?>
                     <?php 
                        if (isset($q->answer2)) {  
                         ?>
                     <tr>
                        <td>
                           <input type="radio" name="<?php echo $q->questionid;?>" value="2" id=""><?php echo $q->answer2;?>
                        </td>
                     </tr>
                     <?php } ?>
                     <?php 
                        if (isset($q->answer3)) {  
                         ?>
                     <tr>
                        <td>
                           <input type="radio" name="<?php echo $q->questionid;?>" value="3" id=""><?php echo $q->answer3;?>
                        </td>
                     </tr>
                     <?php } ?>
                     <?php 
                        if (isset($q->answer4)) {  
                         ?>
                     <tr>
                        <td>
                           <input type="radio" name="<?php echo $q->questionid;?>" value="4" id=""><?php echo $q->answer4;?>
                        </td>
                     </tr>
                     <?php } ?>

When I execute it, it produces the results as shown below
 std 5
Question
Which of the following numbers is divisible by 4

2700

5445

67670

20038

How can I align the text / number to read like below?

Question
Which of the following numbers is divisible by 4
☐  
2700
☐  5445
☐  67670
☐  20038

Your assistance will be appreciated, Thanks

Viewing all articles
Browse latest Browse all 14348

Trending Articles