'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']
    trs = []
    for item in items:
        if ('_id' in item):
            record_id = item['_id']
        else:
            continue
        audit('read', prefix, name, record=record_id, representation='html')
        trow = TR(_class='read-row')
        for f in fields:
            text = xml_decode(item[f['name']]['text'])
            trow.append(XML(xml_decode(text)))
        trs.append(trow)
    return self.subform(data, trs, [], empty=False, readonly=True)
