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