<@U0F3291QE> i'm trying to style the inner child ...
# tornadofx
a
@edvin i'm trying to style the inner child row of the treetableview but as the parent and child both have the same css class name, the style is being applied to all rows.
Copy code
.custom-tree-table-header .tree-table-row-cell{
    -fx-background-color: rgba(199, 204, 228, 0.3);
    -fx-text-fill: black;
    -fx-border-color: #b9bacc;
    -fx-table-cell-border-color:#b9bacc;
    -fx-border-width: 0.2px;
}
.custom-tree-table-header .tree-table-cell{
    -fx-background-color: rgba(255, 255, 255, 0.0);
}
But I want a different color of the child rows.
Copy code
var persons = mutableListOf<Voucher>().observable()
for (i in 1..5)
            persons.add(
                    Voucher("3-4-2017", "HDFC BANK", "Receipt", "1", "3200", "42424", listOf(
                            Voucher("", "JOHN DOE", "Receipt", "1322", "1600", "21212"),
                            Voucher("", "JOHN DOE", "Receipt", "1466", "1600", "21212"),
                            Voucher("", "JOHN DOE", "Receipt", "1466", "1600", "21212"))))

class Voucher(val date: String,
              val particulars: String,
              val voucherType: String,
              val voucherNo: String,
              val debit: String,
              val credit: String,
              val voucherList: List<Voucher> = emptyList())
 
treetableview<Voucher> {

                    style {
                        backgroundColor += Styles.textFieldbackground
                    }


                    addClass("custom-tree-table-header")

                    column("DATE", Voucher::date)
                    column("PARTICULARS", Voucher::particulars)
                    column("VOUCHER TYPE", Voucher::voucherType)
                    column("VOUCHER NO.", Voucher::voucherNo)
                    column("DEBIT", Voucher::debit)
                    column("CREDIT", Voucher::credit)

                    isShowRoot = false

                    root = TreeItem(Voucher("", "",
                            "", "", "", "", persons))

                    populate { it.value.voucherList }

                    root.isExpanded = true

                    columnResizePolicy = TreeTableView.CONSTRAINED_RESIZE_POLICY

                }
This is my implementation. Here is what I have got so far. https://cl.ly/2p0a1D2D0o3C I want to change the style of rows which have "JOHN DOE" And is there any way to handle root in TreeTableView. I've hidden the root in my view as I don't want a single root.