Note that a number of the stock compile Formats have a special Section Layout for the ToC specifically, that is designed to fit the tab stops into the format’s paper size setup.
If you are making your own from scratch, you could still examine one of these and see how it is done. I’ve merged this post with the existing discussion on this matter, and you will find some discussion above on how to do this by hand.