Jump to content

[SOLVED] Checkbox layout


mkr365

Recommended Posts

Hello,

 

I have spend ours and ours just to solve the next problem but i don't see it anymore.

 

I have some problems with the layout of my checkboxes. In iexplorer everthings looks perfectly fine but in firefox its a mess. Sometimes the name of the checkbox is underneath the checkbox instead of the right side of the checkbox, and because of that some checkboxes are not on the same height.

 

I don't have css yet for these checkboxes but is it a css problem? Or is something wrong with my code.

 

$result = mysql_query($sql) or die("MySQL Error<br>SQL statement: $sql<br>Error: ".mysql_error()); 

echo "<table><tr>"; 
$n = 0;

    while($query = mysql_fetch_array($result)) 

    { if($n>0 && ($n%$perrow)==0) echo "</tr><tr>";

        {if ($categorien == $row['RubriekID']) 

              echo '<td><input type="checkbox" class="box" name="categorien[]" value="'.$query['RubriekID'].'">'.$query['Rubrieknaam'].'<td/>'; 
        else 
            echo '<td><input type="checkbox" class="box" name="categorien[]" value="'.$query['RubriekID'].'">'.$query['Rubrieknaam'].'<td/>'; 
    } 
$n++;
}
while(($n++%$perrow)!=0) echo "<td> </td>";
echo "</tr></table>"; 


echo '</td></tr> 
<tr><td colspan="2"><input type="submit" value="zoeken"><input type="hidden" name="zoek" value="true"></td></tr> 

</table>

Link to comment
Share on other sites

I suspect that it has to do with the layout of the table itself, which is sensitive to the width of the display in the browser. You will see similar mess if you start to make your browser window more narrow.

 

One approach may be to set the width of the table columns so that all columns are the same width, but for this you need to know how many columns are to be displayed.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.