You cannot manually set the "Highlight line" for SharePoint list cell. However, you could using jquery to achieve your design.
Please follow steps:
1.Create a Choice column named "Condition"
2.Download the Highlight.js and upload to SharePoint Site Assets Library.
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
(function() {
var overrideCurrentContext = {};
overrideCurrentContext.Templates = {};
overrideCurrentContext.OnPostRender = HighlightProductRows;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCurrentContext);
})();
function HighlightProductRows(ctx) {
var statusColors = {
'Fixed': '#FAF304',
'Flexible': '#FFFFFF'
};
var rows = ctx.ListData.Row;
for (var i = 0; i < rows.length; i++) {
var status = rows[i]["Condition"];
var rowId = GenerateIIDForListItem(ctx, rows[i]);
var row = document.getElementById(rowId);
row.style.backgroundColor = statusColors[status];
}
}
</script>
3.Switch to classic mode, click "Edit page" under the settings menu.
4.Add a Content Editor web part.
5.Select the Content Editor web part and click Edit Web Part. Copy the uploaded Highlight.js link to the "To link to a text file, type a URL" textbox.
- Apply and Stop Edit.
======================== Updated Answer ======================
Please use the following script:
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
(function() {
var overrideCurrentContext = {};
overrideCurrentContext.Templates = {};
overrideCurrentContext.OnPostRender = HighlightProductRows;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCurrentContext);
})();
function HighlightProductRows(ctx) {
var statusColors = {
'Fixed': '#FAF304',
'Flexible': '#FFFFFF'
};
var rows = ctx.ListData.Row;
for (var i = 0; i < rows.length; i++) {
var status = rows[i]["Condition"];
var rowId = GenerateIIDForListItem(ctx, rows[i]);
var row = document.getElementById(rowId);
row.style.backgroundColor = "#FFFFFF";
var cell = row.cells[5];//Replace 5 with your columns cell number
cell.style.backgroundColor = statusColors[status];
}
}
</script>