sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

Wrap text by column

Open john-yick opened this issue 8 years ago • 7 comments

Is there anyway to wrap text per column similar to excel?

image

john-yick avatar Mar 21 '18 03:03 john-yick

Yes, specify cell style like that

cell.s = {
  alignment: {
    wrapText: '1', // any truthy value here
  },
};

sgrogov avatar Jul 25 '18 12:07 sgrogov

Hey @sgrogov , could you kindly tell me how to add the style to merged cells or add the style to a range cells. thank you very much

lujuliang avatar Nov 27 '18 08:11 lujuliang

Hi @lujuliang.

As far as I remember for merged cells you have to set your styles to the top left cell. But for borders styling you have to set styles to each cell just as if they were not merged. And about range of cells just set styles to each cell.

Hope it's clear :)

sgrogov avatar Nov 27 '18 08:11 sgrogov

cell.s = {
  alignment: {
    wrapText: '1', // any truthy value here
  },
};

Plain does not work.

Please provide a complete example, or documentation ...

Documentation on how to use your product EFFECTIVELY would be welcomed :)

atljoseph avatar Mar 25 '19 21:03 atljoseph

@lujuliang cell styling isn't supported in the core library. A fork exists with documentation for cell styles here

ugonnanwosu avatar May 07 '19 15:05 ugonnanwosu

@ugonnanwosu Thanks for the pointer. Could you or any other colleague clarify if I should uninstall xlsx npm package before installing xlsx-style npm package? Thanks!

macaranduba avatar Feb 09 '21 12:02 macaranduba

This, along with other cell styling options, is provided in our Pro builds. We may end up bringing all of that into the open source realm, but that will happen after a v1.0.0 release.

SheetJSDev avatar Sep 18 '21 03:09 SheetJSDev