OnReady Code

import wixData from 'wix-data';

$w.onReady(function () {

return wixData.query("myCollection")

.find()

.then( (results) => {

$w("#myTable").rows = results.items;

} );

} );