Good Idea!
I expanded your method to have more options:
Code:void setup() {
size(400,400);
background(153);
noLoop();
}//setup()
void draw() {
gridWH(100,100,20);
gridWH(4,4,130,130,20);
gridMNC(8,8,4,4,20,color(230,60,100,80));
gridMNC(110,110,5,9,20,color(100,220,70,180));
}//draw()
//========================================================
// grid of given width/height
void gridWHC(int x0, int y0, int w, int h, int cellw, color c) {
stroke(c);
for (int iy=y0; iy<=y0+h; iy+=cellw) line(x0, iy, x0+w, iy);
for (int ix=x0; ix<=x0+w; ix+=cellw) line(ix, y0, ix, y0+h);
}//gridWHC()
void gridWHC(int w, int h, int cellw, color c) {
gridWHC(0,0,w,h,cellw,c);
}//gridWHC()
void gridWHC(int x0, int y0, int w, int h, color c) {
gridWHC(x0,y0,w,h,10,c);
}//gridWHC()
void gridWHC(int w, int h, color c) {
gridWHC(0,0,w,h,10,c);
}//gridWHC()
void gridWH(int x0, int y0, int w, int h, int cellw) {
gridWHC(x0,y0,w,h,cellw,color(20,100,100,80));
}//gridWH()
void gridWH(int w, int h, int cellw) {
gridWHC(0,0,w,h,cellw,color(20,100,100,80));
}//gridWH()
void gridWH(int x0, int y0, int w, int h) {
gridWHC(x0,y0,w,h,10,color(20,100,100,80));
}//gridWH()
void gridWH(int w, int h) {
gridWHC(0,0,w,h,10,color(20,100,100,80));
}//gridWH()
//========================================================
// grid of given #row/#column
void gridMNC(int x0, int y0, int mrow, int ncol, int cellw, color c) {
stroke(c);
int x1=x0+ncol*cellw;
int y1=y0+mrow*cellw;
for (int i=0, iy=y0; i<=mrow; i++, iy+=cellw) line(x0, iy, x1, iy);
for (int i=0, ix=x0; i<=ncol; i++, ix+=cellw) line(ix, y0, ix, y1);
}//gridMNC()
void gridMNC(int mrow, int ncol, int cellw, color c) {
gridMNC(0,0,mrow,ncol,cellw,c);
}//gridMNC()
void gridMNC(int x0, int y0, int mrow, int ncol, color c) {
gridMNC(x0,y0,mrow,ncol,10,c);
}//gridMNC()
void gridMNC(int mrow, int ncol, color c) {
gridMNC(0,0,mrow,ncol,10,c);
}//gridMNC()
void gridMN(int x0, int y0, int mrow, int ncol, int cellw) {
gridMNC(x0,y0,mrow,ncol,cellw,color(20,100,100,80));
}//gridMN()
void gridMN(int mrow, int ncol, int cellw) {
gridMNC(0,0,mrow,ncol,cellw,color(20,100,100,80));
}//gridMN()
void gridMN(int x0, int y0, int mrow, int ncol) {
gridMNC(x0,y0,mrow,ncol,10,color(20,100,100,80));
}//gridMN()
void gridMN(int mrow, int ncol) {
gridMNC(0,0,mrow,ncol,10,color(20,100,100,80));
}//gridMN()