I have a script that converts a select list into a table of checkboxes;
$('#edit-taxonomy-1').parent().append('<table id="checkboxes"><tbody><tr></tr></tbody></table>');
$('#edit-taxonomy-1 option').each(function() {
var label = $(this).html();
var value = $(this).attr('value');
var ind = $(this).index();
if (ind % 3 === 0 ) {
$('#checkboxes tbody').append('</tr><tr><td><input type="checkbox" value="'+value+'">' + label + '</td>');
}
else {
$('#checkboxes tbody').append('<td><input type="checkbox" value="'+value+'">' + label + '</td>');
}
});
$('#edit-taxonomy-1').replaceWith($("#checkboxes"));
However I cannot get every third element to show up in a new row nicely.
Here is a fiddle: http://jsfiddle.net/cxVhz/
It shows what I have and what I want