Skip to content

Superscript an Subscript #555

Closed
Closed
@statzg

Description

@statzg

Hi there,

I need superscript and subscript within cells for my project and was successful in adding this capability by just adding the following line to exceljs/lib/xlsx/xform/style/font-xform.js around line 33:
vertAlign: { prop: 'vertAlign', xform: new StringXform({ tag: 'vertAlign', attr: 'val' }) },
I'm still very unexerienced with github, so I don't know how to get this into the project, but since it seems to be the simplest new feature possible, I would really recommend somebody adds this.
It works as font-property for entire cells:
firstRow.font = { name: 'Arial', family: 2, size: 20, vertAlign: 'superscript'}
or as a rich text property:

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'},
]
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy