How to work with dynamic web table?

You can get the total number of <tr> tags within a <td> tag by giving the xpath of the <td> element by using  this function -
List<WebElement> ele = driver.findElements(By.xpath("Xpath of the table"));
Now you can use a for each loop to loop through each of the <tr> tags in the above list and then read each  value by using getText() method.