Quantcast
Channel: User Federico klez Culloca - Stack Overflow
Viewing all articles
Browse latest Browse all 516

Answer by Federico klez Culloca for How to change color of a cell in HTML table using JSoup?

$
0
0

row.getElementsByTag("td").get(1) returns an Element, which doesn't have a class method.

Though, it has a classNames method, and that accepts a Set<String> as a parameter (even if you just need to pass a single class).

So you can do something like

row.getElementsByTag("td").get(1).classNames(Set.of("highlight-#57d9a3"));

And so on.

Aside from that compilation error, if(status == "Pass")is not how you compare strings in java. You need to do something like if("Pass".equals(status)).


Viewing all articles
Browse latest Browse all 516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>