Skip to content

Commit 16213a2

Browse files
author
m.r
committed
sideBySideLineByLine
1 parent a786d5a commit 16213a2

31 files changed

+3504
-2893
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Version 2.7.0 (2023-09-02)
4+
5+
### New Features
6+
7+
- sideBySideLineByLine, multi-table in single sheet
8+
39
## Version 2.6.0 (2023-08-27)
410

511
### Improvement

README.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,145 @@ ExcelTable.convertTableToExcel("#table", null, true, rowF, colF)
118118

119119
</details>
120120

121+
### sideBySideLineByLine
122+
123+
sideBySideLineByLine is a new feature that provides the ability to generate multi-table in a single sheet Excel
124+
125+
```javascript
126+
const sideData = [
127+
[
128+
{
129+
sheetName: "sheetName",
130+
spaceX: 1,
131+
spaceY: 1,
132+
headers: [
133+
{
134+
label: "id",
135+
text: "id",
136+
},
137+
],
138+
data: [
139+
{ id: 11 },
140+
{ id: 10 },
141+
{ id: 9 },
142+
{ id: 8 },
143+
{ id: 7 },
144+
{ id: 6 },
145+
{ id: 5 },
146+
{ id: 4 },
147+
{ id: 3 },
148+
{ id: 2 },
149+
{ id: 1 },
150+
],
151+
},
152+
{
153+
sheetName: "sheetName",
154+
spaceX: 1,
155+
spaceY: 1,
156+
headers: [
157+
{
158+
label: "el",
159+
text: "el",
160+
},
161+
],
162+
data: [
163+
{ el: 11 },
164+
{ el: 10 },
165+
{ el: 9 },
166+
{ el: 8 },
167+
{ el: 7 },
168+
{ el: 4 },
169+
{ el: 3 },
170+
{ el: 2 },
171+
{ el: 1 },
172+
],
173+
},
174+
],
175+
176+
[
177+
{
178+
sheetName: "sheetName",
179+
spaceX: 1,
180+
spaceY: 1,
181+
headers: [
182+
{
183+
label: "id",
184+
text: "id",
185+
},
186+
{ label: "test", text: "test" },
187+
],
188+
data: [
189+
{ id: 1 },
190+
{ id: 2 },
191+
{ id: 3 },
192+
{ id: 4 },
193+
{ id: 5 },
194+
{ id: 6 },
195+
{ id: 7 },
196+
{ id: 8 },
197+
{ id: 9 },
198+
{ id: 10 },
199+
{ id: 11 },
200+
],
201+
},
202+
{
203+
sheetName: "sheetName1",
204+
spaceX: 1,
205+
spaceY: 1,
206+
headers: [
207+
{
208+
label: "id",
209+
text: "id",
210+
},
211+
{ label: "test", text: "test" },
212+
],
213+
data: [
214+
{ id: 1 },
215+
{ id: 2 },
216+
{ id: 3 },
217+
{ id: 4 },
218+
{ id: 5 },
219+
{ id: 6 },
220+
{ id: 7 },
221+
{ id: 8 },
222+
{ id: 9 },
223+
{ id: 10 },
224+
{ id: 11 },
225+
],
226+
},
227+
{
228+
sheetName: "sheetName",
229+
spaceX: 1,
230+
spaceY: 1,
231+
headers: [
232+
{
233+
label: "id",
234+
text: "id",
235+
},
236+
{ label: "test", text: "test" },
237+
],
238+
data: [
239+
{ test: "test14", id: "u1i1r23" },
240+
{ test: "test13", id: "u2i2r24" },
241+
{ test: "test12", id: "u3i3r25" },
242+
{ test: "test11", id: "u4i4r26" },
243+
{ test: "test10", id: "u5i5r27" },
244+
{ test: "test9", id: "u6i6r28" },
245+
{ test: "test8", id: "u7i7r29" },
246+
{ test: "test7", id: "u8i8r30" },
247+
{ test: "test6", id: "u9i9r31" },
248+
{ test: "test5", id: "ui1010r32" },
249+
{ test: "test4", id: "ui1111r33" },
250+
{ test: "test3" },
251+
{ test: "test2" },
252+
{ test: "test1" },
253+
],
254+
},
255+
],
256+
];
257+
ExcelTable.sideBySideLineByLine(sideData);
258+
```
259+
121260
### generateExcel
122261

123262
```javascript
@@ -2884,6 +3023,7 @@ ExcelTable.generateExcel(data);
28843023
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex16.PNG?raw=true)
28853024

28863025
</details>
3026+
28873027
## Conditional Styling
28883028

28893029
Using the 'styleCellCondition' option, you can apply styles to each cell based on specific conditions as needed.
@@ -3369,6 +3509,12 @@ These alignment options empower you to customize the appearance of cell content
33693509

33703510
## Release Notes
33713511

3512+
### Version 2.7.0 (2023-09-02)
3513+
3514+
#### New Features
3515+
3516+
- sideBySideLineByLine, multi-table in single sheet
3517+
33723518
### Version 2.6.0 (2023-08-27)
33733519

33743520
#### Improvement

dist/excel-table.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ declare interface FormulaSetting {
7676

7777
declare type FormulaType = "AVERAGE" | "SUM" | "COUNT" | "MAX" | "MIN";
7878

79-
export declare function generateExcel(data: ExcelTable): Promise<string | number[] | Blob | Buffer | undefined>;
79+
export declare const generateExcel: typeof generateExcel_2;
80+
81+
declare function generateExcel_2(data: ExcelTable): Promise<string | number[] | Blob | Buffer | undefined>;
8082

8183
declare interface Header {
8284
label: string;
@@ -145,6 +147,20 @@ declare interface Sheet {
145147
data: Data[];
146148
}
147149

150+
declare interface SideBySide {
151+
sheetName?: string;
152+
spaceX?: number;
153+
spaceY?: number;
154+
headers: {
155+
label: string;
156+
text: string;
157+
}[];
158+
data: Data[];
159+
headerIndex?: number;
160+
}
161+
162+
export declare function sideBySideLineByLine(data: SideBySide[][]): Promise<string | number[] | Blob | Buffer | undefined>;
163+
148164
declare interface SortAndFilter {
149165
mode: "all" | "ref";
150166
ref?: string;

0 commit comments

Comments
 (0)