'Render this component read-only (table-style)
@param resource: the S3Resource
@param data: the data dict (as returned from extract())'

def readonly(self, resource, data):

    audit = current.audit
    (prefix, name) = (resource.prefix, resource.name)
    xml_decode = current.xml.xml_decode
    items = data['data']
    fields = data['fields']
    item_rows = []
    columns = self.columns
    for item in items:
        if ('_id' in item):
            record_id = item['_id']
        else:
            continue
        audit('read', prefix, name, record=record_id, representation='html')
        row = DIV(_class='read-row    row')
        for (i, f) in enumerate(fields):
            if (columns and (len(columns) > i)):
                width = columns[i]
            else:
                width = 1
            column_class = ('small-%s    columns' % width)
            if (i == (len(fields) - 1)):
                column_class = ('%s    end' % column_class)
            text = xml_decode(item[f['name']]['text'])
            row.append(DIV(XML(xml_decode(text)), _class=column_class))
        item_rows.append(row)
    return self.subform(data, item_rows, [], empty=False, readonly=True)
