function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rocks_SFDCRocks_SFDC 

Need Help in Building Tables in lightning design system

I wanted to build following kind of table in salesforce lightning.
 
Terms and ConditionsOther 1Other 2
Standard  
    
    
    
    

Could anyone suggest how to proceed and help me out with any sample code.
Arun pattnaik 17Arun pattnaik 17
Use a html table with iteration as below.
<table class="slds-table slds-table_cell-buffer slds-table_bordered">
        <thead>
            <tr class="slds-line-height_reset">
                
                <aura:iteration items="{!v.headerLIst}" var="item" indexVar="key">
                    <th class="slds-text-title_caps" scope="col">
                        
                        'define your headers'
                    </th>
                </aura:iteration> 
            </tr>
        </thead>
        <tbody>
           <aura:iteration items="{!v.rowList}" var="item" indexVar="rowKey">
                <tr class="slds-hint-parent" data-label="{!item.name}" onclick="{!v.onRowClick}">
                    <th data-label="Opportunity Name" scope="row">
                        <div class="slds-truncate" title=""  >{!item.name}</div>
                    </th>
                    
                    <aura:iteration items="{!item.columns}" var="item1" indexVar="key">
                        
                        'List your columns'
                    </aura:iteration>
                </tr>
            </aura:iteration>
        </tbody>
    </table>

Define a json accordingly to support your structure sompething similar to this- 

   var allValues = response.getReturnValue();
                
            var opt=[];
                for (var i = 0; i < allValues.length; i++) {
                   
                    opt.push({
                        id: rec[1],
                        name: rec[0],
                        columns:helper.getColumns(component, event, helper,rec[0]) //list out the json structure for the columns you want to show.
                        
                    });
                component.set("v.rowList", opt);