import http.server


class EigenerHandler(http.server.BaseHTTPRequestHandler):

    def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type', 'text-html')
        self.end_headers()

        von = 3
        bis = 10



        msg = """
            <html>
                <head>
                    <style>
                    table, th, td {
                    border: 1px solid black;
                    }
                    </style>
                </head>
                <body>
                    <h2>Quadratzahlen</h2>
                        
                    <table style="width:100%">
        """

        while von <= bis:
            msg = msg + "<tr><td>{}</td><td>{}</td></tr>".format(von, von*von)
            von = von + 1

        msg = msg + """
                    </table>
                </body>
            </html>
        """

        self.wfile.write(msg.encode())

port = 12345
Handler = EigenerHandler
address = ('', port)

server = http.server.HTTPServer(address, Handler)
server.serve_forever()