I have successfully used the jQuery : nth-child () selector to remove the right margin from every fourth element in a long list of DIVs. It looks like this:
$(".myDivClass:nth-child(4n+4)").css("margin-right", 0);
But the page is also open for user interaction (via jQuery), and one of the things the user can do is hide / show elements. When an element is hidden, its style is set to "display: none". Elements move, therefore, if you delete one element in the middle of a line, the element from the line below bounces, for example:

, , , visible; - :
$(".myDivClass").css("margin-right","20px");
$(".myDivClass:visible:nth-child(4n+4").css("margin-right", 0);
, , , (?)
? ?
!
/