Skip to main content

I am trying to align this table columns but the column border is not aligning uniformly in the table, can anyone please help me out what changes or approach need to be followed 

 

#Aura Component #Aura Lightning Components #Lightning Aura #Lightning Aura Component

How to align columns uniformly using html table

   

<table class="slds-table slds-table_bordered " style="width:100%;">

<thead>

<tr class="slds-text-heading_label" style="width:50%;">

<th scope="col" style="width:10%;text-align: center; border-right:1px solid #C2DBF1;z-index:0; border-top:1px solid #C2DBF1;" ><div class="slds-truncate" title="SO NAME">SO Name</div></th>

<th>

<th scope="col" style="width:10%;text-align: center; border-right:1px solid #C2DBF1; z-index:0; " ><div class="slds-truncate" title="TODAY PJP">Today PJP</div></th>

<th scope="col" style="width:10%;text-align: center; border-right:1px solid #C2DBF1; z-index:0; " ><div class="slds-truncate" title="STAUS">STATUS</div></th>

</th>

</tr>

</thead>

<tbody>

<aura:iteration items="{!v.visitRec}" var="item">

<tr style="width:50%;" >

<td style="word-wrap: break-word;white-space: normal;text-align: center; width:10%;z-index:0;background:#F8F8F8;border-right: 1px solid #C2DBF1; border-left: 1px solid #C2DBF1;">

<div data-id="{!item.soId}" onclick ="{!c.showMonthlyPJP}">

<a >{!item.soName}</a></div>

</td>

<td style="width:20%" colspan="2">

<aura:iteration items="{!item.todayPJP}" var="pjp">

<tr>

<aura:if isTrue="{!pjp.Beat__r.Name}">

<td style="text-align: center; width:10%;z-index:0;border-right: 1px solid #C2DBF1;"><lightning:formattedText value="{!pjp.Beat__r.Name}" /></td>

<td style="text-align: center; width:10%;z-index:0;"><lightning:input type="checkbox" disabled="true" checked="{!pjp.Visiting__c}" /></td>

<aura:set attribute="else">

<td style="text-align: center; width:10%;z-index:0;border-right: 1px solid #C2DBF1;"><lightning:formattedText value="{!item.noBeat}" /></td>

<td style="text-align: center; width:10%;z-index:0;"><lightning:input type="checkbox" disabled="true" checked="{!pjp.Visiting__c}" /></td>

</aura:set>

</aura:if>

</tr>

</aura:iteration>

</td>

</tr>

</aura:iteration>

</tbody>

</table>

3 respuestas
  1. 21 sept 2021, 7:43

    There are two aura: iterations.

    Therefore, I think it is separated from the header.

    I think there is no choice but to fix it with pixel.

0/9000