'Return HTML table rows, optionally limiting to a number of rows.'

def render(self, max_rows=None, rows=None):

    if (not rows):
        rows = self.rows(max_rows)
    max_visits = (max((r['visits'] for r in rows)) if rows else 0)
    for r in rows:
        visits = r['visits']
        r['percent'] = (0 if ((visits is None) or (not max_visits)) else int(round(((visits / float(max_visits)) * 100))))
    return render_to_string('dashboards/includes/kb_readout.html', {'rows': rows, 'column3_label': self.column3_label, 'column4_label': self.column4_label}, request=self.request)
