What it should do:
Create a 17x10 grid of "#", each with a link to a variant of a command supplied as sCommandHead and sCommandFoot, containing the colour it is.

What it actually does:
Create a 17x10 grid of "#", each with a link to a variant of a command supplied as sCommandHead and sCommandFoot, containing the colour of the "#" one space to the right, with the right edge not being links, and the empty space to the left being the links to the variant with the left edge's colours.