Home > Article > Web Front-end > How to use js-xlsx to merge cells
This time I will show you how to use s-xlsx to merge cells, and what are the precautions for using s-xlsx to merge cells. The following is a practical case, let's take a look.
Import data observation data format
1.1. Let’s first create an xlsx table with merged cells
Let’s take the example of header data merging:
Example
1.2. Write a simple data import function (you can refer to the article in the preface to write it, I will not put the code )
Import xlsx reference data format:
Example
........ data["!merges"] = [{ s: {//s为开始 c: 1,//开始列 r: 0//可以看成开始行,实际是取值范围 }, e: {//e结束 c: 4,//结束列 r: 0//结束行 } }]; ........2. Hands-on experiment2.1. Write a simple Export demo
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website! Related reading:
How to use s-xlsx to import and export Excel files (Part 2)
How to use s-xlsx -xlsx implements Excel file import and export (Part 1)
The above is the detailed content of How to use js-xlsx to merge cells. For more information, please follow other related articles on the PHP Chinese website!