I have a table in my aura component. I use class="slds-max-medium-table_stacked but I can't see header. I want result as in the link: How to present a lightning-datatable on mobile devices?

1 Answer 1


For this we can simple add data-label="Label" to our tag:

<table class="slds-table slds-table--bordered slds-table--striped slds-max-medium-table_stacked-horizontal">
                <th>Appraisal Name</th>
                <th>Advertised Price</th>
                <th>Customer Trade Value</th>
                <th>Trading Value</th>
        <tbody class="slds-text-body_regular">
            <aura:iteration items="{!v.appraisals}" var="appraisal">
                    <td data-label="Appraisal Name">{!appraisal.Name}</td>
                    <td data-label="Advertised Price">Test</td>
                    <td data-label="Customer Trade Value">Test</td>
                    <td data-label="Trading Value">Test</td>

You must log in to answer this question.

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