Skip to content
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

How can i set padding to a Paragraph? #2671

Closed
jimmywong123 opened this issue Apr 9, 2024 · 1 comment
Closed

How can i set padding to a Paragraph? #2671

jimmywong123 opened this issue Apr 9, 2024 · 1 comment

Comments

@jimmywong123
Copy link

jimmywong123 commented Apr 9, 2024

WX20240409-152040@2x
like this paragraphy, i want to set some padding like css in the text.

new Paragraph({
  text: title,
  style: 'bannerText',
  shading: {
    type: ShadingType.CLEAR,
    fill: "3978BB",
  },
})
@jimmywong123
Copy link
Author

here is what i do:

new Table({
      rows: [
        new TableRow({
          children: [
            new TableCell({
              children: [
                new Paragraph({
                  text: title,
                  style: 'bannerText',
                })
              ],
              shading: {
                type: ShadingType.CLEAR,
                color: "ffffff",
                fill: "3978BB",
              },
              borders: {
                top: disableBorder,
                right: disableBorder,
                bottom: disableBorder,
                left: disableBorder,
              },
              margins: {
                top: 50,
                right: 50,
                bottom: 50,
                left: 50,
              },
              width: {
                size: 8970,
                type: WidthType.DXA,
              }
            })
          ]
        })
      ],
      borders: {
        top: disableBorder,
        right: disableBorder,
        bottom: disableBorder,
        left: disableBorder,
      },
      width: {
        size: 9070,
        type: WidthType.DXA,
      }
    })
  }

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

No branches or pull requests

1 participant