I would like to ask python how to format to achieve different length of string adding interval to achieve head-to-tail juxtaposition?

as shown in the picture, I can only juxtaposition left or right side by side with format. If I use join to add spaces, I can"t realize that these three rows are all 25 characters. May I ask how to solve the problem? -sharp-sharp-sharp topic description

Jan.25,2022

import pandas as pd
df=pd.DataFrame([['The/NOUN'], ['Apple/NOUN'], ['Orange/NOUN']],columns=['words'])
df1=df['words'].str.split('/',expand=True)
df1['size']=df['words'].str.len()
df2=df1[0]+df1['size'].map(lambda x:(26-x)*' ')+df1[1]
print(df2)
Menu