It seems that I have something that sort of works, in the previous posting. (Using betzaCSS.js as script source.)
It appears that it is essential to make every item request its position, because the grid container will be filled with more columns than the grid-template-columns specifies, if there is room. (An alternative I did not try was to specify the size of the container.)
I was wrong in <div> elements having no padding; they pad on the left to create a margin. So I did have to set the padding to 0px. This has to be done in every item; unlike for a <table> you cannot do it globally in the container.
Remaining problem is to get a border collapse. With the gap set to 0px the borders of the items touch, and you get a double-width border. Setting the gap to -1 soesn't appear to work.
It seems that I have something that sort of works, in the previous posting. (Using betzaCSS.js as script source.)
It appears that it is essential to make every item request its position, because the grid container will be filled with more columns than the grid-template-columns specifies, if there is room. (An alternative I did not try was to specify the size of the container.)
I was wrong in <div> elements having no padding; they pad on the left to create a margin. So I did have to set the padding to 0px. This has to be done in every item; unlike for a <table> you cannot do it globally in the container.
Remaining problem is to get a border collapse. With the gap set to 0px the borders of the items touch, and you get a double-width border. Setting the gap to -1 soesn't appear to work.