As others mentioned in Bootstrap 3, you can use nest/embed techniques.
However it is becoming more obvious to use pretty awesome feature from Bootstrap 4 now. you simple have the option to use the col-{breakpoint}-auto
classes (e.g. col-md-auto
) to make columns size itself automatically based on the natural width of its content. check this for example