Skip to content

Commit

Permalink
Update table.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhesh-Agarwal authored Jun 21, 2021
1 parent bece8d0 commit 1071c06
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions src/sierra/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,35 @@ def getTable(self, dataframe:str):
open("index.html", 'a').write(f'''\n</table>''')

def css(self, border=False, width=False, height=False, border_collapse=False, color='black', font_family="Arial", font_weight=False, text_align=False, font_size=False, margin=False, background_color='white'):
"""
Args:
border (str, optional) : CSS border parameter. Defaults to False.
width (str, optional) : CSS border width parameter. Defaults to False.
height (str, optional) : CSS height parameter. Defaults to False.
border_collapse (str, optional) : CSS border-collapse parameter. Defaults to False.
color (str, optional) : CSS color parameter. Defaults to 'black'.
font_family (str, optional) : CSS font-family parameter. Defaults to "Arial".
font_weight (str, optional) : CSS font-weight parameter. Defaults to False.
text_align (str, optional) : CSS text-align parameter. Defaults to False.
font_size (str, optional) : CSS font_size parameter. Defaults to False.
margin (str, optional) : CSS margin parameter. Defaults to False.
background_color (str, optional) : CSS background-color parameter. Defaults to 'white'.
"""

with open('style.css', 'a') as s:
if self.id == 'False':
s.write(f'''\ntable {{''')
else:
s.write(f'''\n#{str(self.id)} {{''')
s.write(f'''color: {color};
font-family: {font_family};
font-weight: {font_weight};
text-align: {text_align};
font-size: {font_size};
background-color: {background_color};
border: {border};
height: {height};
width: {width};
margin: {margin};
}}''')
s.write(f'''\n#{self.id} {{''')
s.write(f''' border: {border};
width: {width};
height: {height};
border-collapse: {border_collapse};
color: {color};
font-family: {font_family};
font-weight: {font_weight};
text-align: {text_align};
font-size: {font_size};
margin: {margin};
background-color: {background_color};
}}''')

0 comments on commit 1071c06

Please sign in to comment.