I want to optimize this code instead of using td(String.valueof(dataset.get()))
mutliple times. I am relatively new to lambda expressions usage and not able to figure out a better way than this
Code need to be optimized
return table(thead(tr(each(columnHeaders, header ->
th(String.valueOf(header))))),
tbody(each(myList, dataset ->
tr(td(String.valueOf(dataset.get(0))),
td(String.valueOf(dataset.get(1))),
td(String.valueOf(dataset.get(2))),
td(String.valueOf(dataset.get(3))),
td(String.valueOf(dataset.get(4))),
td(String.valueOf(dataset.get(5))),
td(String.valueOf(dataset.get(6))),
td(String.valueOf(dataset.get(7))),
td(String.valueOf(dataset.get(8))),
td(String.valueOf(dataset.get(9))),
td(String.valueOf(dataset.get(10)))
))
)
)