Selenium Webdriver Java: How to click on a particular cell in table using row and column numbers
<p>I have written a code to verify if a given text is present in that row or not but how do i click in a  particular cell? Please help me.<br>
Below is the code i have written for verifying the text.</p>

<pre><code>package com.Tables;

import java.util.List;

public class HandlingTables {

public static void main(String[] args) throws InterruptedException {
    String s="";
    System.setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.get("http://www.w3schools.com/html/html_tables.asp");
    WebElement table = driver.findElement(By.className("w3-table-all"));
    List&lt;WebElement&gt; allrows = table.findElements(By.tagName("tr"));
    List&lt;WebElement&gt; allcols = table.findElements(By.tagName("td"));
    System.out.println("Number of rows in the table "+allrows.size());
    System.out.println("Number of columns in the table "+allcols.size());

    for(WebElement row: allrows){
        List&lt;WebElement&gt; Cells = row.findElements(By.tagName("td"));
        for(WebElement Cell:Cells){
            s = s.concat(Cell.getText());   
        }
    }
    System.out.println(s);
    if(s.contains("Jackson")){
        System.out.println("Jackson is present in the table");
    }else{
        System.out.println("Jackson is not available in the table");
    }
    Thread.sleep(10000);
    driver.quit();
  }
}  
</code></pre>