Table Resizing Issue on Mobile

Hello! I recently added a searchable table to my site with search functionality. The table appears properly for mobile initially, but once you enter a search term and hit submit the table reloads/refreshes as if it’s on a desktop. Below is the code. Any help would be greatly appreciated!

import wixWindow from ‘wix-window’ ;
import wixData from “wix-data” ;
export function button3_click(event) {
if (wixWindow.formFactor === “Mobile” ) {

wixData.query( “MSRPPrices” )
// Query the collection for any items whose “Name” field contains
// the value the user entered in the input element
.contains( “brandName” , $w( “#input4” ).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w( “#table1” ).rows = res.items;
});

$w.onReady( function () {

$w( “#table1” ).columns = [{
“id” : “col1” ,
“dataPath” : “brandName” ,
“label” : “Brand Name” ,
“type” : “string” ,
}, {
“id” : “col2” ,
“dataPath” : “size” ,
“label” : “Size (ml)” ,
“type” : “string” ,
}, {
“id” : “col3” ,
“dataPath” : “msrp” ,
“label” : “MSRP” ,
“type” : “string” ,
}];
});
}
}

Thank you!