Spacing between columns in CSS grids
You can set the distance between grid columns. This is done using the column-gap
property, which is set on the parent element.
Let's set the distance in pixels between columns in the grid:
<div id="parent">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
#parent {
display: grid;
column-gap: 20px;
grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr;
padding: 10px;
border: 2px solid #696989;
width: 600px;
height: 200px;
}
#parent > div {
padding: 10px;
border: 1px solid #696989;
}
:
Create a table where the distance between columns is 20%
.