'Modified version of docutils.writers.html4css1.Writer.visit_entry
Adds a wrapping <p> tag to table cell content.'

def visit_entry(self, node):

    atts = {'class': []}
    if isinstance(node.parent.parent, nodes.thead):
        atts['class'].append('head')
    if node.parent.parent.parent.stubs[node.parent.column]:
        atts['class'].append('stub')
    if atts['class']:
        tagname = 'th'
        atts['class'] = '    '.join(atts['class'])
    else:
        tagname = 'td'
        del atts['class']
    node.parent.column += 1
    if ('morerows' in node):
        atts['rowspan'] = (node['morerows'] + 1)
    if ('morecols' in node):
        atts['colspan'] = (node['morecols'] + 1)
        node.parent.column += node['morecols']
    self.body.append(self.starttag(node, tagname, '', **atts))
    self.body.append(self.starttag(node, 'p', '', dict()))
    self.context.append(('</p></%s>\n' % tagname.lower()))
    if (len(node) == 0):
        self.body.append('&nbsp;')
    self.set_first_last(node)
