Skip to content

Commit aec8ed7

Browse files
committed
static table alignment
1 parent fb5136a commit aec8ed7

File tree

3 files changed

+288
-273
lines changed
  • core
    • generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io
    • src/main/kotlin/org/jetbrains/kotlinx/dataframe/io
  • examples/notebooks/netflix

3 files changed

+288
-273
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/html.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public fun AnyFrame.toStaticHtml(
220220
// properly laid out with borders.
221221
fun StringBuilder.emitHeader() = emitTag("thead") {
222222
for (row in colGrid) {
223-
emitTag("tr") {
223+
emitTag("tr", "align=\"left\"") {
224224
for ((j, col) in row.withIndex()) {
225225
val colBorders = col.borders.toMutableSet()
226226
// check if the next cell has a left border, and if so, add a right border to this cell
@@ -267,7 +267,7 @@ public fun AnyFrame.toStaticHtml(
267267
}
268268

269269
// Adds a single row to the html. This row uses the flattened columns to get them displayed non-collapsed.
270-
fun StringBuilder.emitRow(row: AnyRow) = emitTag("tr") {
270+
fun StringBuilder.emitRow(row: AnyRow) = emitTag("tr", "align=\"right\"") {
271271
for ((i, col) in flattenedCols.withIndex()) {
272272
val border = borders[i].toMutableSet()
273273
// check if the next cell has a left border, and if so, add a right border to this cell

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/html.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public fun AnyFrame.toStaticHtml(
220220
// properly laid out with borders.
221221
fun StringBuilder.emitHeader() = emitTag("thead") {
222222
for (row in colGrid) {
223-
emitTag("tr") {
223+
emitTag("tr", "align=\"left\"") {
224224
for ((j, col) in row.withIndex()) {
225225
val colBorders = col.borders.toMutableSet()
226226
// check if the next cell has a left border, and if so, add a right border to this cell
@@ -267,7 +267,7 @@ public fun AnyFrame.toStaticHtml(
267267
}
268268

269269
// Adds a single row to the html. This row uses the flattened columns to get them displayed non-collapsed.
270-
fun StringBuilder.emitRow(row: AnyRow) = emitTag("tr") {
270+
fun StringBuilder.emitRow(row: AnyRow) = emitTag("tr", "align=\"right\"") {
271271
for ((i, col) in flattenedCols.withIndex()) {
272272
val border = borders[i].toMutableSet()
273273
// check if the next cell has a left border, and if so, add a right border to this cell

0 commit comments

Comments
 (0)