Learn how to create crisp, responsive grids using the HTML5 Canvas and JavaScript. We cover all sorts of fun stuff like grid mathematics, DPI handling, and a boatload more.

https://www.kirupa.com/canvas/drawing_perfect_grid.htm