N-by-2 grid, and if the last row has only a single column, center it
问题 I want to have an N-by-2 grid like this, in which some elements (columns) might be set to display:none based on run-time factors, making the number of rows and columns unknown in advance at the design time. So it could look like this: 1 2 3 4 5 or 1 2 4 5 (3 is missing) or 1 3 (2, 5 is missing) 4 (4 is the last column) I want the last element to be always centered. I make each div .col-xs-6 to make the grid N-by-2. What can I do to make the last column to always be in center? Last column,