<div id="btns">
  <button>start</button>
  <button>center</button>
  <button>end</button>
  <button>space-around</button>
  <button>space-evenly</button>
</div>

<div id="container">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>
body {
  align-items: center;
  background: #333;
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
}

#btns {
  margin-bottom: 16px;
}

#container {
  background-color: orangered;
  display: grid;
  grid-template-columns: 80px 80px;
  grid-auto-rows: 80px;
  grid-gap: 10px;
  width: 500px;
  height: 400px;
  padding: 16px;
}

.item {
  align-items: center;
  background-color: white;
  margin: 1px;
}
$("button:not(.remove)").on("click", function () {
  $("#container").css("place-content", $(this).text());
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js