Press see inside to make this work. Please don't copy this, it hurt my brain to make and if you do just credit me (although I don't know what you would use this for)
Maximum grid size is 11 by 9 but if smaller it will increase, just adjust the X and Y positions in the custom block to make up for the size. Also if you change the centering you can get a much more efficient grid.