aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/table/Cell.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/table/Cell.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt b/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
index 0a79c9f9..44646897 100644
--- a/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/table/Cell.kt
@@ -64,6 +64,22 @@ open class Cell(
this.add(cell)
return cell
}
+
+ /**
+ * DSL builder extension function.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+ fun Row.thcell(
+ content: String? = null,
+ rich: Boolean = false,
+ align: Align? = null,
+ classes: Set<String> = setOf(), init: (HeaderCell.() -> Unit)? = null
+ ): HeaderCell {
+ val headerCell = HeaderCell(content, rich, align, Scope.ROW, classes, init)
+ this.add(headerCell)
+ return headerCell
+ }
}
}