Skip to content

Commit 9cc04e0

Browse files
authored
basic template
1 parent f1cee87 commit 9cc04e0

File tree

1 file changed

+29
-46
lines changed

1 file changed

+29
-46
lines changed

README.md

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,56 @@ A react library to render and display excel sheets on webpage
33

44
---
55

6-
### Prerequisites
7-
What things you need to install the software and how to install them
6+
## Installation
87

98
```
10-
Give examples
9+
npm install react-excel-renderer --save
1110
```
1211

13-
### Installing
14-
A step by step series of examples that tell you how to get a development env running
15-
16-
Say what the step will be
17-
12+
## Usage
13+
* Import the primary module *ExcelRenderer* to convert sheet data into JSON format.
14+
* Also import *OutTable* to display the obtained JSON into a HTML Table.
1815
```
19-
Give the example
16+
import {OutTable, ExcelRenderer} from 'react-excel-renderer';
2017
```
21-
22-
And repeat
23-
18+
* Provide binary object (blob) of the excel file to be rendered, to the *ExcelRenderer* function to obtain JSON data from sheet
2419
```
25-
until finished
20+
//let blob be the binary data of the file
21+
ExcelRenderer(blob, (err, resp) => {
22+
//handle fail case here
23+
if(err){
24+
console.log(err);
25+
}
26+
//handle success case here
27+
else{
28+
this.setState({
29+
cols: resp.cols, //state variable containing columns
30+
rows: resp.rows //state variable containing all rows obtained from sheet
31+
});
32+
}
33+
});
2634
```
27-
28-
End with an example of getting some data out of the system or using it for a little demo
29-
30-
## Running the tests
31-
Explain how to run the automated tests for this system
32-
33-
### Break down into end to end tests
34-
Explain what these tests test and why
35-
35+
* Use the OutTable component to render obtained JSON data into HTML table, and provide classnames as props to make table look alike an Excel Sheet
3636
```
37-
Give an example
37+
<OutTable data={this.state.rows} columns={this.state.cols} tableClassName="ExcelTable2007" tableHeaderRowClass="heading" />
3838
```
39+
* To make this table look more like an excel sheet, follow this article - [Quick CSS Tools to make your web page tables to look just like excel](https://www.cogniview.com/articles-resources/quick-css-tools-for-making-your-web-tables-look-just-like-excel)
3940

40-
### And coding style tests
41-
Explain what these tests test and why
4241

43-
```
44-
Give an example
45-
```
42+
**Note:** Once the JSON data is obatined, you can also use other options to render them instead of the OutTable component. For example, [CanvasDataGrid](https://github.com/TonyGermaneri/canvas-datagrid) provides various features to render tabular data.
4643

47-
## Deployment
48-
Add additional notes about how to deploy this on a live system
4944

5045
## Built With
51-
* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
52-
* [Maven](https://maven.apache.org/) - Dependency Management
53-
* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds
54-
55-
## Contributing
56-
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
46+
* [SheetJS](https://github.com/SheetJS/js-xlsx) - The web page sheet framework used
5747

58-
## Versioning
59-
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
6048

6149
## Authors
62-
* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)
63-
64-
See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
50+
**Ashish Deshpande** - *Initial work* - [Ashish's Github Profile](https://github.com/ashishd751)
6551

6652
## License
67-
6853
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
6954

7055
## Acknowledgments
71-
72-
* Hat tip to anyone whose code was used
73-
* Inspiration
74-
* etc
56+
* Special shout out to the guys at **Sheet JS** for developing the parent library
57+
* High gratitude towards Bernard Bado to help me publish my first npm package
7558

0 commit comments

Comments
 (0)