Depending on what browsers you need to support, you may be able to use flexbox:
$('.tab').click(function() {
$(this).css('display', 'none');
});
.container {
display: flex;
}
.tab {
border: 1px solid black;
padding: 5px;
flex: 1;
margin: 5px;
}
Click a tab to remove it