html = """
<html>
  <head>
    <style>
      /* Add your CSS styles here */
    </style>
  </head>
  <body>
    <table>
      {% for row in board %}
      <tr>
        {% for square in row %}
        <td class="{{ square }}"></td>
        {% endfor %}
      </tr>
      {% endfor %}
    </table>
  </body>
</html>
"""

board = [    ["black", "white", "black", "white", "black", "white", "black", "white"],
    ["white", "black", "white", "black", "white", "black", "white", "black"],
    ["black", "white", "black", "white", "black", "white", "black", "white"],
    ["white", "black", "white", "black", "white", "black", "white", "black"],
    ["black", "white", "black", "white", "black", "white", "black", "white"],
    ["white", "black", "white", "black", "white", "black", "white", "black"],
    ["black", "white", "black", "white", "black", "white", "black", "white"],
    ["white", "black", "white", "black", "white", "black", "white", "black"],
]

print(html.format(board=board))
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb Cell 1 in <cell line: 32>()
      <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0'>1</a> html = """
      <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1'>2</a> <html>
      <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2'>3</a>   <head>
   (...)
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=18'>19</a> </html>
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=19'>20</a> """
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=21'>22</a> board = [    ["black", "white", "black", "white", "black", "white", "black", "white"],
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=22'>23</a>     ["white", "black", "white", "black", "white", "black", "white", "black"],
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=23'>24</a>     ["black", "white", "black", "white", "black", "white", "black", "white"],
   (...)
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=28'>29</a>     ["white", "black", "white", "black", "white", "black", "white", "black"],
     <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=29'>30</a> ]
---> <a href='vscode-notebook-cell://wsl%2Bubuntu/home/kcabralomana/Fastpages/_notebooks/2022-01-06-chessboard.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=31'>32</a> print(html.format(board=board))

KeyError: '% for row in board %'