aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt b/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
index b70845d6..14527f0f 100644
--- a/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/table/HeaderCell.kt
@@ -25,6 +25,11 @@ import pl.treksoft.kvision.html.Align
import pl.treksoft.kvision.html.TAG
import pl.treksoft.kvision.html.Tag
+enum class Scope(internal val scope: String) {
+ ROW("row"),
+ COL("col")
+}
+
/**
* HTML table header cell component.
*
@@ -39,11 +44,16 @@ open class HeaderCell(
content: String? = null,
rich: Boolean = false,
align: Align? = null,
+ scope: Scope? = null,
classes: Set<String> = setOf(),
init: (HeaderCell.() -> Unit)? = null
) : Tag(TAG.TH, content, rich, align, classes) {
init {
+ scope?.let {
+ @Suppress("LeakingThis")
+ setAttribute("scope", it.scope)
+ }
@Suppress("LeakingThis")
init?.invoke(this)
}
@@ -58,9 +68,10 @@ open class HeaderCell(
content: String? = null,
rich: Boolean = false,
align: Align? = null,
+ scope: Scope? = null,
classes: Set<String> = setOf(), init: (HeaderCell.() -> Unit)? = null
): HeaderCell {
- val cell = HeaderCell(content, rich, align, classes, init)
+ val cell = HeaderCell(content, rich, align, scope, classes, init)
this.add(cell)
return cell
}