I am trying to create a bootstrap 3 columns with 12 rows using following php for loop. But it's showing all the data in one column. How can I make this for loop result in bootstrap 3 columns ( col-md-4 ) ?
Php For Loop:
<?php
for ( $x = 1; $x <= 36; $x++) {
if( $x % 12 == 0 || $x == 1 ) {
echo "<div class='col-md-4'>";
}
?>
<div class="checkbox form-inline">
<label><input type="checkbox" name="ch_name[]" value="ch<?php echo $x; ?>">CH<?php echo $x; ?></label>
<input type="text" name="ch_for[]" value="" placeholder="Channel details" class="form-control ch_for">
</div>
<?php if( $x % 12 == 0 ) {
echo "</div>";
}
}
?>