Multiplication tables

Hi,

I’m trying to create multiplication tables in Android Studio using tablayouts. So far I was able to create multiplication tables function, but how to adapt this to tabs (which are 1-10), so want on each change to calculate output based on that number. Also, I’m pretty confused how to use adapters etc. any good instructions would help as the one I found on the net are not helping me…

class DataSource() {

fun TTables(): {
    val num = 5

    for (i in 1..10) {
        val product = num * i

        println("$num * $i = $product")
    }
}

}

Thanks,

Art