strokeWeight(1); // the same line weight
stroke("#ffffff1a")
for (let r = 0; r < rows; r++) {
let y = (height/rows) * (r+1)
line(0, y, width, y)
// rect(0, y, width, 1)
for (let c = 0; c < cols; c++) {
let x = (width/cols) * (c+1)
line(x, 0, x, height)
// rect(x, 0, 1, height)
}
}

Welcome! 馃憢 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
oops. the actual problem is using a nested loop. it'll create vertical lines on every horizontal line created
sorry about that
for (let r = 0; r < rows; r++) {
let y = (height/rows) * (r+1)
line(0, y, width, y)
// rect(0, y, width, 1
}
for (let c = 0; c < cols; c++) {
let x = (width/cols) * (c+1)
line(x, 0, x, height)
// rect(x, 0, 1, height)
}