I have a table with multiple rows and delete icon with each row. I have to hide that delete icon from first row so user can not able to delete the first row.
I have tried this so far.
Code :
<div className="panel-body">
<div className="row grid-divider">
<div className="col-sm-6">
<div className="col-padding">
<div className="pos-div"><h4>{_labels.LOCATION_PANEL_CFG_LOCATION}</h4><a data-toggle="toggle" data-target="#jdCheckbox2" className="jdClickable2" onClick={() => this.deleteChekedAll()} style={this.props.conLocations.length < 2 ? {pointerEvents: 'none' }:null}>{_labels.LOCATION_PANEL_SELECT_ALL}</a><button className="allLargeBtn" onClick={() => this.delAllChecked()} disabled={this.props.conLocations.length < 2}> {_labels.LOCATION_PANEL_REMOVE} </button></div>
<div><table className="table configTableColor"><thead>{this.props.conLocations.map((locc, index) => <tr key={index}><th><input type="checkbox" id="#jdCheckbox2" onChange={() => this.deleteToggle(locc.mruCode)} checked={this.props.isDeleted.find(chkItems => chkItems.mruCode === locc.mruCode)} /><label></label></th><th className="configLocationInfo">{locc.mruCode} - {_labels[locc.division]} - {locc.country}</th><th className="text-right"><img alt="DeleteIcon" onClick={() => this.handleRemove(locc.mruCode)} className={this.props.conLocations.length===1?"deleteIconStyle1":"deleteIconStyle"} src="img/delete_large_active.png" /></th></tr>)}</thead></table></div>
</div>
</div>
</div>
</div>
css code:
.deleteIconStyle {
width: 16px;
cursor: pointer;
}
.deleteIconStyle1{
opacity: 0;
}
how to hide delete icon from first row of a table in react js
index,index == 0 ? null : <a></a>.