How is this called? [Gridding, Math]

Hello ^^
Im having problems with gridding with specific number typed and gridding layouts!
Heres an example of what i mean:
Items: 5

{
   [1] = {[1] = "", [2] = "", [3] = ""},
   [2] = {[1] = "", [2] = ""}
}

But the problem is, that its not the only grid layout im looking for.
I want to make a hatch based system made from a grid system, it should like start to split on 6, 9 etc… [this is like a gridding idk how it could be achieved, as example i would say the gridding of ps99 hatching grid]

It would be nice if someone knows a good website or video out there explaining grid systems like this! [i think a math vid is enough]

Thank you so much for reading this, and especially for those who helped! ^^