visit
It has a simple way of organizing, positioning and displaying elements using column reordering, which I discovered when working on my project at . As the name implies, the concept allows you to reorder columns based on the screen size of the device used to view the page.
In this publication, I am going to show how to reorder columns using bootstrap. At the time of writing, the current version of bootstrap was 4.1, hence refer to the implementation of this concept in the version of bootstrap you are using to achieve the desired results.To start, by default, all columns have an order value of 0 but I assigned class “order-1” to the desired columns. This if omitted will still display columns based on their appearance in the code.See code and output below:
The above snippet shows that on medium-sized screens (MD) the columns are displayed based on the order value assigned to them. This means if it is required that the order changes on let’s say large screens, then
order-lg-[value]
will be assigned to the various columns.Protip: column reordering only works on bootstrap columns: col-[xx], container or container-fluid, not rows
The image below shows a practical example of column reordering where I built an online sneaker shop that required column reordering on different screens sizes.