I'm trying to create a responsive div list
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
<a href="#">
<img src="https://dummyimage.com/250x250/000/fff">
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
<a href="#">
<img src="https://dummyimage.com/250x250/000/fff">
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
<a href="#">
<img src="https://dummyimage.com/250x250/000/fff">
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
<a href="#">
<img src="https://dummyimage.com/250x250/000/fff">
</a>
</div>
</div>
As you can see, from above i have four divs and when i only have 3 divs, they will in left
Is it possible do it dynamically when there is only 3 div and they will be centered ?
If yes, how can i do that. Thanks in advance and sorry for my bad english