This should work for you:
".row" #> myList.map(x => {
val rowId = x.id
"tr [id]" #> rowId &
".cell1 *" #> x.data &
".cell2 *" #> x.moreData
})
To set an attribute, you usually just need to specify the name of the attribute inside of []
. So, in addition to ID
, if you wanted to add a class, it would be [class]
. There is also a special modifier, +
which will append to the current value. So [class+]
will add whatever you specify to the current values.
It is also worth noting that some drafts of the HTML spec require at least one letter in the ID
, see this question for an explanation of why.