Dynamically change Column width

Is it possible to change from col-12 to col-6 dynamically?

If yes. How?