Wha can I do to highlight my first complete column of the table with a background color? Below is my code and screenshot of the table. Problem is that I'm using <template for:each={con.listval} for:item="item"> to fetch records so if I use style for <div> inside this template then it highlights both column.

enter image description here


<table class="slds-table slds-table_cell-buffer slds-table_bordered">
                        <tr class="slds-line-height_reset">
                            <th class="" scope="col">
                                <div class="slds-truncate" title="Field Names">Field Names</div>
                            <th class="" scope="col">
                                <div class="slds-truncate" title="Primary Record">Primary Record</div>

                    <template for:each={listOfField} for:item="con">
                        <tbody key={con}>
                            <tr key={con}>
                                <th style="height: 25px">

                                <template for:each={con.listval} for:item="item">
                                    <th key={item} scope="col" data-key={item}>
                                        <div class="slds-truncate" title={item.con}>
                                            <c-child-record-component objrec={item} fieldname={con.key}
                                                fieldvalue={item.fieldValue} recordid={item.radioButton}
                                                firstrecordid={firstRecordId} onfieldselection={onFieldSelection}>

1 Answer 1


I am assuming this as your first column

th style="height: 25px; background-color:red !important;"



Try this out, moreover i am subtle about the css atrributes which you used in table tag

class="slds-table slds-table_cell-buffer slds-table_bordered"

Try removing them after above code once, sometimes slds attributes does not allow other css to work, basically it overrides.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .