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
Jessie ChaiJessie Chai 

How to display two sets of table data in one column?

I use lightning-datatable and need to display the addresses in the same table. The upper part is the English address, and the lower is the Chinese address. What do I need to do? I connected the <br/> in the js file corresponding to the lightningn web component, but it didn't work. Please advise.
User-added image
AnudeepAnudeep (Salesforce Developers) 
Hi Jessie,

I recommend using concatenation for columns of lightning datatable. Found the below code online, sharing it for your reference
 
public wrapp(Account acct){
        id = acct.Id;
        name = acct.Name + '-'+acct.Master_Customer_ID__c;   
        mdm = acct.Master_Customer_ID__c;     
    }
concatenateCols() {
    this.columns = [...this.columns, { label: 'fruit-weight', fieldName: 'fruitWeight' }];
    this.data = this.data.map(item => {
        return { ...item, fruitWeight: [[code]]czoxNTI6XCIke2l0ZW0ubmFtZSA/IGl0ZW0ubmFtZSA6ICYjMDM5OyYjMDM5O30keyhpdGVtLm5hbWUgJmFtcDsmYW1wOyBpdGVtLnd7WyYqJl19ZWlnaHQgPyAmIzAzOTsgLSAmIzAzOTsgOiAmIzAzOTsmIzAzOTspfSR7aXRlbS53ZWlnaHQgPyBpdGVtLndlaWdodCA6ICYjMDM5O3tbJiomXX0mIzAzOTt9XCI7e1smKiZdfQ==[[/code]] };
    });
}