You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-36Lines changed: 39 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ We have four functions that are defined with specific use cases as follows:
69
69
70
70
-**`convertTableToExcel`**: This function is designed exclusively for **client-side** use. It requires passing a DOM element (a table element) as a parameter. The output of this function is an Excel file generated from the provided table.
71
71
72
-
<aid="side-by-side-line-by-line"></a>
72
+
<aid="side-by-side-line-by-line"></a>
73
73
74
74
-**`sideBySideLineByLine`**: This function offers the capability to generate a single-sheet Excel file containing multiple tables side by side and line by line.
75
75
@@ -154,10 +154,10 @@ Ensure you choose the appropriate method based on your installation preferences
154
154
155
155
After adding the library to your project, generating XLSX files becomes straightforward. You can achieve this by creating a data object similar to the code snippet below:
Each sheet has options for customization. You can change the sheet name using name, adjust the tab name color with tabColor, control visibility with state, add protection to a sheet via protectionOption, and implement sorting and filtering using sortAndFilter. In the example below, we will demonstrate how to utilize these properties. Additionally, for Excel file information, we offer options such as creator, created, notSave, and modified.
778
780
779
781
<details>
@@ -1796,10 +1798,10 @@ const data = {
1796
1798
};
1797
1799
```
1798
1800
1799
-
## Header Option [⬆️](#table-of-contents)
1800
-
1801
1801
<aid="header"></a>
1802
1802
1803
+
## Header Option [⬆️](#table-of-contents)
1804
+
1803
1805
We offer specific header options for Excel headers. The header is a mandatory component, so the withoutHeader option cannot be used to omit it. The headerHeight option is employed to determine the height of the header row. Additionally, we provide the headerStyleKey property, which specifies the most commonly used style for each cell (its value corresponds to the style ID; detailed functionality is explained in the Styles section).
1804
1806
1805
1807
Each header cell is endowed with properties beyond the label and text. The size property defines the width of the column, while the formula property applies a formula to all rows (excluding the header) within the column, ultimately affecting the final cell in that column.
We provide two distinct methods for defining formulas: customization and column type. In the customization approach, if you employ a cell containing data that is used within the formula, the formula will display an instance of the formula. When using the customization type, it's important to specify the formula type, which can be any of the following: AVERAGE, SUM, COUNT, MAX, or MIN.
## Styles & Format Options [⬆️](#table-of-contents)
2552
-
2553
2553
<aid="styles-format"></a>
2554
2554
2555
+
## Styles & Format Options [⬆️](#table-of-contents)
2556
+
2555
2557
In the library, styles are defined with an ID that represents the desired style. This ID is then used to apply the corresponding style to cells. Each cell is associated with only one style. These styles encompass various attributes such as borders, alignment, text color, font family, font size, background, and bold, among others.
2556
2558
2557
2559
The format property is a distinct style attribute. Unlike other styles, the format is predefined and cannot be customized.
With this library, you can group rows together using two properties added to the data: outlineLevel and hidden. The outlineLevel represents the grouping level, while hidden represents whether the default state is collapsed or not. The key of this property is changeable, so in case of a conflict with your data, you have the flexibility to modify it. We will discuss how to change the key in the next section.
The shift feature allows you to adjust the starting point of generating an Excel file. The title option, on the other hand, is used when you want to include a title at the top of the generated file.
You can apply Excel conditional formatting in two ways. One method is through the Header object, which affects a whole column. The other method is using the Sheet object, where you need to specify the start and end properties.
General use and sheet objects offer the same functionality but are more flexible, allowing you to apply them to multiple columns and various other use cases
0 commit comments