JSFiddle - React, Tailwind, and code Playground

HTML

<ul id="list">
    <li>1</li>            
    <li>2</li>            
    <li>3</li>            
    <li>4</li> 
    <li>5</li>            
    <li>6</li>                
</ul>
<div style="clear: both; overflow: hidden;">
</div>

<p style="width: 400px;">You will see that the items 2, 4, 6 have margin right of 10px - I need to be able to set these to zero so using jquery to add a class of "last" to each item to reset within the CSS</p>

CSS

ul {
    margin: 0;
    padding: 0;
    width: 300px;
}

ul li {
    float: left;
    width: 140px;
    background: red;
    margin: 0 10px 10px 0;
}