How to change Tag Cloud to a Grid layout

To change Tag Cloud to a Grid layout, from this.

to this.

You can use this code to Custom CSS.

ul.sqs-tagcloud span {
    font-size: 24px !important;
}
ul.sqs-tagcloud a {
    width: 100%;
    display: block;
}
ul.sqs-tagcloud {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    grid-column-gap: 5px;
    grid-row-gap: 20px;
}
@media screen and (max-width:767px) {
    ul.sqs-tagcloud {
        grid-template-columns: repeat(2,1fr) !important;
    }
}