Skip to content

Add vertical align property #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 26, 2019
Merged

Add vertical align property #758

merged 3 commits into from
Apr 26, 2019

Conversation

MikeZyatkov
Copy link
Contributor

@MikeZyatkov MikeZyatkov commented Mar 7, 2019

Add support vertical align property (vertAlign) with possible values are superscript and subscript.
Related to #555

Use:
for entire cell
firstRow.font = { name: 'Arial', family: 2, size: 20, vertAlign: 'superscript'}

rich text:
worksheet.getCell('A10').value = { 'richText': [ {'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'This is '}, {'font': {'italic': true,'size': 12,'color': {'theme': 1},'name': 'Calibri','vertAlign': 'superscript'},'text': 'superscript'}, {'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'and '}, {'font': {'italic': true,'size': 12,'color': {'theme': 1},'name': 'Calibri','vertAlign': 'subscript'},'text': 'subscript'}, ] };

Add support vertical align property (vertAlign) with possible values are superscript and subscript.

Use:
for entire cell
firstRow.font = { name: 'Arial', family: 2, size: 20, vertAlign: 'superscript'}

rich text:
worksheet.getCell('A10').value = {
'richText': [
	{'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'This is '},
	{'font': {'italic': true,'size': 12,'color': {'theme': 1},'name': 'Calibri','vertAlign': 'superscript'},'text': 'superscript'},
	{'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'and '},
	{'font': {'italic': true,'size': 12,'color': {'theme': 1},'name': 'Calibri','vertAlign': 'subscript'},'text': 'subscript'},
]
};
Copy link

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be so kind and add some tests? That would be awesome!

@MikeZyatkov
Copy link
Contributor Author

@BridgeAR
I added some tests, but I'm not sure that they are completely correct. If they aren't good enough, please give me advice and I will correct them.

@alubbe alubbe requested a review from guyonroche April 3, 2019 08:59
@wukaikailive
Copy link

wukaikailive commented Apr 21, 2019

@guyonroche When to merge this part of the code

@Siemienik
Copy link
Member

@MikeZyatkov could I please you for update Readme?

@MikeZyatkov
Copy link
Contributor Author

@Siemienik done

@Siemienik Siemienik merged commit e7926cf into exceljs:master Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants