         }
 
         try body.append(contentsOf: stem.render(leaf, with: context))
-        body.append(contentsOf: "</tbody></table>".makeBytes())
+        body.append(contentsOf: "</tbody></table></div>".makeBytes())
         return body
     }
 }

    public let name = "table"

    public func run(arguments: ArgumentList) throws -> Node? {
        var table = "<table class=\"table\"><tbody><tr>"

        for arg in arguments.list {
            guard let arg = arg.value(with: arguments.stem, in: arguments.context)?.string else {

            table.append("<th>\(arg)</th>")
        }

        table.append("</tr></thead><tbody>")

        return .bytes(table.makeBytes())
    }
