Created
December 12, 2015 18:15
-
-
Save pzzrudlf/52ff8d731298f231d8c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table id="__01" class="table-responsive" border="0" cellpadding="0" cellspacing="0"> | |
| <?php | |
| $i = 0; | |
| $content = ''; | |
| foreach ($indexdata as $key => $value) { | |
| if ($i%2 == 0){//每7列换一行,配合下面的判断使用 | |
| $content .= '<tr>'; | |
| } | |
| $id = $value['id']; | |
| $content .= '<td><a href="/default/show?category_id='.$id.'">'.json_decode($value['name'], true)['data']['zh-cn'].'</a></td>'; | |
| if ($i%2 == 1){//每7列换一行,配合上面的判断使用 | |
| $content .= '</tr>'; | |
| } | |
| $i++; | |
| } | |
| echo $content; | |
| ?> | |
| </table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment