Equal-Width Columns
You do not have to set numbers every time. If you only write col, Bootstrap divides the space equally between all the columns in that row.
The first row has two halves. The second row has three equal thirds.
Setting the Width of One Column
If you give one column a number, the other columns share the remaining space equally.
Here the middle column takes half the row. The two col columns share the remaining half, so each gets 3 parts.
Variable Width Content: col-auto
col-auto makes the column only as wide as its content. The other col columns use the rest of the space.
Real Example: Search Bar
A long input field with a small button right next to it. The button stays small and the input takes all remaining space.
Responsive Equal Width
You can also use col-sm, col-md and others without a number. Columns are stacked below that breakpoint and become equal width above it.
Summary of Column Types
| Class | Behavior |
|---|---|
col | Equal share of the remaining space |
col-6 | Exactly 6 of 12 parts |
col-auto | Width of its content |
col-md | Equal width from md up, stacked below |
col-md-auto | Width of content from md up, stacked below |
col-auto for buttons, icons and labels, and col for flexible areas such as inputs and text blocks.
Conclusion
Auto layout saves you from doing the math. Use col when you want equal widths and col-auto when the content should decide the width.

