Det kunne være noget i stil med:
<style type="text/css">
body {
margin: 0;
padding: 0;
font: 12px verdana, arial, sans-serif;
}
#test_level_search div {
display: inline-block;
vertical-align: top;
margin: 6px;
border: 1px solid red;
}
#test_level_search div label {
display: block;
}
</style>
<form name="test_search" action="/index.html" method="post" id="test_level_search">
<input name="search_test_level" value="31803" type="radio"> 1<br />
<input name="search_test_level" value="31797" type="radio"> 2<br />
<input name="search_test_level" value="31795" type="radio"> 3<br />
<input name="search_test_level" value="31801" type="radio"> 4<br />
<input name="search_test_level" value="13058" type="radio"> 5<br />
<input name="search_test_level" value="31801" type="radio"> 6<br />
<input name="search_test_level" value="31792" type="radio"> 7<br />
<input name="search_test_level" value="31793" type="radio"> 8<br />
<input name="search_test_level" value="31804" type="radio"> 9<br />
<input name="search_test_level" value="13055" type="radio"> 10<br />
<input name="search_btn" class="button" value="Søg" type="submit">
</form>
<script type="text/javascript">
var elmF = document.getElementById("test_level_search"),
aRads = elmF.getElementsByTagName("input"),
numRads = aRads.length;
numDivs = Math.floor(numRads/5),
oFrag = document.createDocumentFragment(),
elmDiv = document.createElement("div"),
elmLbl = null;
oFrag.appendChild(elmDiv);
aRads = Array.prototype.slice.call(aRads, 0);
for (var i=0; i<numRads; i++) {
if (aRads[i].type!="radio") continue;
if (i>0 && i%5==0) {
elmDiv = document.createElement("div");
oFrag.appendChild(elmDiv);
}
elmLbl = document.createElement("label");
elmLbl.appendChild(aRads[i].nextSibling);
elmLbl.insertBefore(aRads[i], elmLbl.firstChild);
elmDiv.appendChild(elmLbl);
}
while (elmF.firstChild && elmF.firstChild.nodeName.toLowerCase()!="input") {
elmF.removeChild(elmF.firstChild);
}
elmF.insertBefore(oFrag, elmF.firstChild);
</script>