JavaScript Markdown Table Generator

The code below and the CodePen.io demo will generate a button which reveals a grid of squares which the user can hover over and click to generate a Markdown Table where each square on the horizontal axis is a table column and the vertical axis is a table row.

Demo