Setting styles

Style example
Create a spreadsheet class with style and export as html.

Styles available:

  • font_family - Font family (e.g "Arial")
  • font_size - Font size (e.g. "12pt")
  • color - Font color (e.g. "#ff0000")
  • backgroun_color - Cell background color (e.g. "#ffff00")
  • border_top - Cell top border style (e.g. "1pt solid #ffff00")
  • border_bottom - Cell bottom border style (e.g. "1pt solid #ffff00")
  • border_left - Cell left border style (e.g. "1pt solid #ffff00")
  • border_right - Cell right border style (e.g. "1pt solid #ffff00")

from simpleodspy.sodsspreadsheet import SodsSpreadSheet
from simpleodspy.sodshtml import SodsHtml
t = SodsSpreadSheet()
t.setValue("A1:A3", "green")
t.setStyle("A1:A3", background_color = "#00ff00")
t.setValue("B1:B3", "blue")
t.setStyle("B1:B3", background_color = "#0000ff")
t.setStyle("B3", border_top = "1pt solid #ff0000", border_bottom = "1pt solid #ff0000")
tw = SodsHtml(t)"test.html")