JSFiddle - React, Tailwind, and code Playground

by xixonia

HTML

<div>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
</div>

CSS

div>div
{
    border: 1px solid black;
    float:left;
    background: red;
    width: 100px;
    height: 40px;
}

JavaScript

$(function() {
    var $child = $('div>div');
    $child.width($child.parent().width() / $child.length - 2);
});