How can i sort row in table

Hello teams,

Please how can i sort rows in ascending and descending order in table ?
Thank you

However you sort your table manually, that is how you try to get KS to do it. Maybe try and click on a Heading. If your table is sortable, that might initiate the table to sort.

Maybe like:

Edit: I assume no special sorting icon and only one heading row.
As an example, to sort the table based on the first column:

import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.testobject.ConditionType as ConditionType
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

xpath = '//table/thead/tr[1]/th[1]'
TestObject myHead = new TestObject(xpath)
myHead.addProperty("xpath", ConditionType.EQUALS, xpath)


import org.openqa.selenium.By as By
import org.openqa.selenium.Keys as Keys
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement 
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

xpath = '//table/thead/tr[1]/th[1]'
pHead = driver.findElement(By.xpath("${xpath}"));