luci-base: mvalue: fix column wrapping
[project/luci.git] / modules / luci-base / luasrc / view / cbi / mvalue.htm
index 246ef43..db17450 100644 (file)
@@ -36,7 +36,7 @@
                                <label<%= attr("for", cbid.."-"..key)%>></label>
                                <%=pcdata(self.vallist[i])%>
                        </label>
                                <label<%= attr("for", cbid.."-"..key)%>></label>
                                <%=pcdata(self.vallist[i])%>
                        </label>
-                       <% if i == self.size then write('<br />') end %>
+                       <% if self.size and (i % self.size) == 0 then write('<br />') end %>
                <% end %>
        </div>
 <% end %>
                <% end %>
        </div>
 <% end %>