emptyindorill,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
li{
padding:5px;
}
.nav-column {
border: 1px solid Blue;
margin: 3px;
list-style: none;
}
</style>
<title></title>
<script>
document.addEventListener('DOMContentLoaded', fn, false);
function wrapEach(element, wrapper, countToWrap, cls){
var container;
[].forEach.call( document.querySelectorAll(element), function(el,i) {
i % countToWrap || (container = document.createElement(wrapper),
cls && container.classList.add(cls),
el.parentNode.replaceChild(container,el));
container.appendChild(el);
});
}
function fn()
{
wrapEach('.dropdown_2columns .level2>li','div',5,'nav-column');
}
</script>
</head>
<body>
<div class="dropdown_2columns">
<ul class="level2">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>16</li>
<li>17</li>
</ul>
</div>
</body>
</html>