I have a problem to show photos with two table headings(th) in one for loop.
I have a array of 8 photos now I want to show 4 photos in one table and then 4 other photos in next table with one more heading, see my attached screenshot,I'm using forloop but not success,it is showing in one table not two. how I can do this I have a array of 8 photos and want to show something like screenshot.
My code:
<table class="table table-bordered" style="float:left; width:400px;">
<thead>
<tr>
<th>Private</th>
<th>Public</th>
<th>Photos</th>
</tr>
</thead>
<?php foreach(Yii::app()->session['photos'] as $imageKey=>$image):?>
<tbody>
<tr>
<td><input type="radio" name="month1" value="1month" /></td>
<td><input type="radio" name="month1" value="1month" /></td>
<td><div class="span2" id="photo_<?php echo $imageKey;?>"><a href="#"><img src="<?php echo Yii::app()->createAbsoluteUrl('renterphotos');?>/<?php echo $image;?>"></a></div></td>
</tr>
</tbody>
<?php endforeach; ?>
</table>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…