I want to remove the spaces on both sides of the matrix (split with tab), why only the last line is executed and meets the requirements

function takeout(th) {

    var text2 = $("-sharpdata_matrix").val();//

    var allcon2 = text2.split("\n");//

    for (var i =0; i < allcon2.length; iPP) {//

        a = allcon2[i].split("\t");  //tab
       
            var ha=a.join("\t");//tab
            
        // console.log(ha);
         
            $(th).val($.trim(ha));//
    }
    return true;//
}



textarea  

< textarea onblur = "takeout (this);" id= "data_matrix" rows= "20" cols= "100"

        style=" height:218px;min-height:218px;width: 100%;margin-bottom: 20px;">ID    Zygote    2_cell    4_cell    8_cell    Morula    ICM

Pou5f1 1 6 0.6 0.1 16
Sox2 25 0.5 0.2 2 6651
Gata2 3 4 0.4 0.3 3 46
cMyc 4 3 0.3 0.4 4 36
Tet1 5 2 0.2 0.5 5 25
Tet3 6 1 0.1 0.6 6 1 < / textarea >


the last assignment overrides the previous one

var text = [];
for (var i =0; i < allcon2.length; iPP) {//

        a = allcon2[i].split('\t');  //tab
       
            var ha=a.join("\t");//tab
            
        // console.log(ha);
         
         
         //   $(th).val($.trim(ha));//
         //
         text.push($.trim(ha));
    }
    $(th).val(text.join('\n'))
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37b8a-2c0d2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37b8a-2c0d2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?