1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$trigger = 0;
$currentDepthLevel = $arResult["SECTIONS"][0]["DEPTH_LEVEL"];
echo '<table><tr>';
foreach ( $arResult as $key => $value ){
echo '<td>';
echo '<a href="'.$value["SECTION_PAGE_URL"].'">'.$value["NAME"].'</a>';
echo '</td>';
if ( $value["DEPTH_LEVEL"] != $currentDepthLevel ){
$trigger++;
$currentDepthLevel = $value["DEPTH_LEVEL"];
}
if ( $trigger == 3 ){
$trigger = 0;
echo '</tr><tr>';
}
}
echo '</tr></table>';
?>