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
bretondevbretondev 

ligthning:dataTable not displaying correctly

Hello ,

I have a ligthning:dataTable not displaying correctly.

There is no header visible and also data is not visible.
Please explain why.
 
<aura:if isTrue="{!v.showCsResults}">          	
            <lightning:datatable data="{!v.csResults}" columns="{!v.csResultsColumns}" keyField="siret" hideCheckboxColumn="true" onrowaction="{!c.siretiser}" />
        </aura:if>
 
init: function (component, event, helper) {
        //This method is called on initialization
        //It formats the lightning:dataTable that will display the CS results with the appropriate columns and data types
        
         var actions = [
            { label: 'Sirétiser', name: 'siretiser' },
        ];
        
        component.set('v.csResultsColumns', [
             		{label: 'Siret', 							fieldName: 'siret', 	type: 'text'},
            		{label: 'Nom du Compte', 					fieldName: 'nomCompte', type: 'text'},
                    {label: 'Rue', 								fieldName: 'rue', 		type: 'text'},
            		{label: 'CP', 								fieldName: 'cp', 		type: 'text'},
            		{label: 'Ville', 							fieldName: 'ville', 	type: 'text'},
            		{ type: 'action', typeAttributes: { rowActions: actions } }
                ]);
    }


 
var csresults = new Array();
                    
					for (var item of results.companies) {
                        var csresult = new Object();
                        csresult.siret = item.regNo;
                        csresult.nomCompte = item.name;
                        csresult.rue = item.address.street;
                        csresult.cp = item.address.postalCode;
                        csresult.ville = item.address.city;
                        
                        csresults.push(csresult);
                    }
                    
                    
                    component.set('v.csResults', csresults);
                    component.set('v.showCsResults', true);


 
Best Answer chosen by bretondev
bhanu_prakashbhanu_prakash
Hi  bretondev,

issue is with UI please provide your css too 
try these CSS
.THIS.slds - scrollable_y {
    min - height: 150 px
}
component as
<div tabindex="-1" class="slds-scrollable_y" style="width: 902px;">
    <table role="grid" class="slds-table ...


Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com