This question has been answered before, but my string doesn't have any extra curly brackets that would mess up the formatting, so at the moment I'm completely clueless as to why the error
Error is KeyError : content
html = """
<table class=\"ui celled compact table\" model=\"{model}\">
{theaders}
<tbody>
{content}
</tbody>
</table>
"""
html = html.format(model=model)
html = html.format(content=data)
html = html.format(theaders=theaders)