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
https://forums.phpfreaks.com/topic/106084-solved-checkbox-layout/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.