CarisMu commited on
Commit
12ce41f
1 Parent(s): c9bd480

update table style

Browse files
Files changed (1) hide show
  1. main.py +22 -2
main.py CHANGED
@@ -287,6 +287,14 @@ dataset_comparison1 = pd.DataFrame(
287
  }
288
  )
289
 
 
 
 
 
 
 
 
 
290
  table_html = dataset_comparison1.to_html(index=False, border=0)
291
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
292
 
@@ -365,7 +373,14 @@ dataset_comparison2 = pd.DataFrame(
365
  ],
366
  }
367
  )
368
-
 
 
 
 
 
 
 
369
  table_html2 = dataset_comparison2.to_html(index=False, border=0)
370
  table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
371
 
@@ -425,7 +440,12 @@ dataset_sources = pd.DataFrame(
425
  ],
426
  }
427
  )
428
-
 
 
 
 
 
429
  table_html_data = dataset_sources.to_html(index=False, border=0)
430
  table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
431
 
 
287
  }
288
  )
289
 
290
+ # Apply table styling: Light green for the header, alternating white and light grey for rows
291
+ styled_table = dataset_comparison1.style.set_properties(
292
+ **{'background-color': rgb(234 255 241)}, subset=pd.IndexSlice[0,:]
293
+ ).apply(
294
+ lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237 242 251)' for i in range(len(x))],
295
+ axis=0
296
+ )
297
+ styled_table
298
  table_html = dataset_comparison1.to_html(index=False, border=0)
299
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
300
 
 
373
  ],
374
  }
375
  )
376
+ # Apply table styling: Light green for the header, alternating white and light grey for rows
377
+ styled_table = dataset_comparison2.style.set_properties(
378
+ **{'background-color': rgb(234 255 241)}, subset=pd.IndexSlice[0,:]
379
+ ).apply(
380
+ lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237 242 251)' for i in range(len(x))],
381
+ axis=0
382
+ )
383
+ styled_table
384
  table_html2 = dataset_comparison2.to_html(index=False, border=0)
385
  table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
386
 
 
440
  ],
441
  }
442
  )
443
+ # Apply table styling: Light green for the header, alternating white and light grey for rows
444
+ styled_table = dataset_comparison1.style.apply(
445
+ lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237 242 251)' for i in range(len(x))],
446
+ axis=0
447
+ )
448
+ styled_table
449
  table_html_data = dataset_sources.to_html(index=False, border=0)
450
  table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
451