There is not a way to designate a "stretchable" part of an endcap that would accommodate variable widths. If your wall is symmetrical, and your endcap involves like items wrapping around the end of the partition, you may find
this blog article of interest. By overlapping the wrapping components, rather than having them just meet, you can cover a range of widths. Depending upon the expected widths, you may be able to set up two or three endcap styles that would cover them all, rather than a separate style for each width.