I'm a new here, and a new to Python. In Python, how to move an align-self to left or right? According to my codes below, how to move Atomic Number to upper on the left-hand side and Atomic Weight to lower on the left-hand side? Here are the codes.
class Element(Button):
def __init__(self, info, **kwargs):
super(Element, self).__init__(**kwargs)
self.info = info
self.background_color = ELEMENT_COLOR_MAP[info["Element_Category"]]
self.text = "[size=17]{}\n[/size][size=32][b]{}[/b][/size][size=17]\n{}[/size][size=17]\n{}[/size]".format(
info['Atomic_Number'], info['Symbol'], info['Name'], info['Atomic_Weight'])
self.text_size = self.size
self.halign = 'center'
self.valign = 'middle'
self.markup = True
I've tried to change it many times, but it doesn't work anymore. Please suggest me or fix it for me. Thank you!
I tried to fix the code by changing self.halign = 'left'
, but everything moved to the left side. I only want to move the Atomic Number (to the upper left-hand side) and Atomic Weight (to the lower left-hand side), while keeping the Symbol and Name in the middle positions.