Split Footer Links Into Columns

Hi,

I want to split my footer links ( generated from pages ) into multiple columns. I have looked through grav and twig docs and just cant seem to get it to work. Here is my codes:

    <ul>
         {% macro loop(page) %}
             {% for p in page.children.visible %}
                 {% if p.children.visible.count > 0 %}
                     <li>
                         <a href="{{ p.url }}">
                             {% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
                             {{ p.menu }}
                         </a>
                        {{ _self.loop(p) }}
                     </li>
                 {% else %}
                     <li class="{{ current_page }}">
                         <a href="{{ p.url }}">
                             {% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
                             {{ p.menu }} 
                         </a>
                     </li>
                 {% endif %}
             {% endfor %}
         {% endmacro %}

        {{ _self.loop(pages) }}
    </ul>
---