JSFiddle - React, Tailwind, and code Playground

by scrimothy

HTML

<div class="sub cf">
  <div class="row">
      <div class="col">
          Column 1
      </div>

    <div class="col">
        Column 2
      </div>

      <div class="col">
        Column 3
    </div>

    <div class="col">
        Column 4
    </div>
      
  </div>
</div>
<div id="output"></div>

CSS

.sub {
  width: 670px;
  background: #fff;
  border: 10px solid #414042;
}

.sub .row {
  padding: 0;
  float: left;
  width: 100%;
}

.sub .row .col {
  float: left;
  border-right: 1px solid #D0D2D3; 
  margin: 0;
  padding: 0;
}


.cf::before, .cf::after {
  content: "";
  display: table;
}
.cf::after {
  clear: both;
}

JavaScript

var colWidth = (1 / $('.sub.cf .row').children().length * 100) + '%';

$('.sub.cf .col').outerWidth(colWidth);
$('#output').html(colWidth);