Index: django/contrib/admin/templatetags/admin_list.py
===================================================================
--- django/contrib/admin/templatetags/admin_list.py	(revision 11840)
+++ django/contrib/admin/templatetags/admin_list.py	(working copy)
@@ -242,7 +242,7 @@
                 result_repr = conditional_escape(result_repr)
             yield mark_safe(u'<td%s>%s</td>' % (row_class, result_repr))
     if form:
-        yield mark_safe(force_unicode(form[cl.model._meta.pk.name]))
+        yield mark_safe(u'<td>%s</td>' % force_unicode(form[cl.model._meta.pk.name]))
 
 def results(cl):
     if cl.formset:
Index: tests/regressiontests/admin_changelist/tests.py
===================================================================
--- tests/regressiontests/admin_changelist/tests.py	(revision 11840)
+++ tests/regressiontests/admin_changelist/tests.py	(working copy)
@@ -1,7 +1,8 @@
 import unittest 
 from django.contrib import admin
 from django.contrib.admin.views.main import ChangeList
-from regressiontests.admin_changelist.models import Child
+from django.template import Context, Template
+from regressiontests.admin_changelist.models import Child, Parent
 
 class ChangeListTests(unittest.TestCase):
     def test_select_related_preserved(self):
@@ -15,6 +16,40 @@
                 m.list_select_related, m.list_per_page, m.list_editable, m)
         self.assertEqual(cl.query_set.query.select_related, {'parent': {'name': {}}})
 
+    def test_result_list_html(self):
+        """
+        Regression test for #11791: Inclusion tag result_list generates a 
+        table and this checks that the items are nested within the table
+        element tags.
+        """
+        new_parent = Parent.objects.create(name='parent')
+        new_child = Child.objects.create(name='name', parent=new_parent)
+        request = MockRequest()
+        m = ChildAdmin(Child, admin.site)
+        cl = ChangeList(request, Child, m.list_display, m.list_display_links, 
+                m.list_filter,m.date_hierarchy, m.search_fields, 
+                m.list_select_related, m.list_per_page, m.list_editable, m)
+        FormSet = m.get_changelist_formset(request)
+        cl.formset = FormSet(queryset=cl.result_list)
+        template = Template('{% load admin_list %}{% spaceless %}{% result_list cl %}{% endspaceless %}')
+        context = Context({'cl': cl})
+        table_output = template.render(context)
+        self.assertEqual(table_output, u'<table cellspacing="0"><thead><tr><th class="action-checkbox-column"><input type="checkbox" id="action-toggle" /></th><th><a href="?ot=asc&amp;o=1">\nName\n</a></th><th><a href="?ot=asc&amp;o=2">\nParent\n</a></th></tr></thead><tbody><tr class="row1"><td><input type="checkbox" class="action-select" value="1" name="_selected_action" /></td><th><a href="1/">name</a></th><td>Parent object</td><td><input type="hidden" name="form-0-id" value="1" id="id_form-0-id" /></td></tr></tbody></table>')
+
+        # Test with list_editable fields
+        m.list_display = ['id', 'name', 'parent']
+        m.list_display_links = ['id']
+        m.list_editable = ['name']
+        cl = ChangeList(request, Child, m.list_display, m.list_display_links, 
+                m.list_filter,m.date_hierarchy, m.search_fields, 
+                m.list_select_related, m.list_per_page, m.list_editable, m)
+        FormSet = m.get_changelist_formset(request)
+        cl.formset = FormSet(queryset=cl.result_list)
+        template = Template('{% load admin_list %}{% spaceless %}{% result_list cl %}{% endspaceless %}')
+        context = Context({'cl': cl})
+        table_output = template.render(context)
+        self.assertEqual(table_output, u'<table cellspacing="0"><thead><tr><th class="sorted descending"><a href="?ot=asc&amp;o=0">\nID\n</a></th><th><a href="?ot=asc&amp;o=1">\nName\n</a></th><th><a href="?ot=asc&amp;o=2">\nParent\n</a></th></tr></thead><tbody><tr class="row1"><th><a href="1/">1</a></th><td><input name="form-0-name" value="name" class="vTextField" maxlength="30" type="text" id="id_form-0-name" /></td><td>Parent object</td><td><input type="hidden" name="form-0-id" value="1" id="id_form-0-id" /></td></tr></tbody></table>')
+
 class ChildAdmin(admin.ModelAdmin):
     list_display = ['name', 'parent']
     def queryset(self, request):
