Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-html-table-to-excel

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-html-table-to-excel

Small react component for converting and downloading HTML table to Excel file

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9K
increased by0.27%
Maintainers
1
Weekly downloads
 
Created
Source

ReactHTMLTableToExcel

Provides a client side generation of Excel (.xls) file from HTML table element.

Build Status

NPM


No additional dependencies


Installation

npm install --save react-html-table-to-excel

Features

  • Download HTML table as Excel file in .xls format
  • No server side code
  • Set desired .xls filename and sheet
  • Set desired class name and id for styling
  • Supported IE 11

Options

A list of available properties can be found below. These must be passed to the containing ReactHTMLTableToExcel component.

PropertyTypeDescription
tablestringID attribute of HTML table element.
filenamestringName of Excel file.
sheetstringName of Excel sheet.
idstringID attribute of button element.
classNamestringClass attribute of button element.
buttonTextstringButton text.

Example

import React, {Component} from 'react';
import ReactHTMLTableToExcel from 'react-html-table-to-excel';

class Test extends Component {

    constructor(props) {
        super(props);
    }

    render() {

        return (
            <div>
                <ReactHTMLTableToExcel
                    id="test-table-xls-button"
                    className="download-table-xls-button"
                    table="table-to-xls"
                    filename="tablexls"
                    sheet="tablexls"
                    buttonText="Download as XLS"/>
                <table id="table-to-xls">
                    <tr>
                        <th>Firstname</th>
                        <th>Lastname</th>
                        <th>Age</th>
                    </tr>
                    <tr>
                        <td>Jill</td>
                        <td>Smith</td>
                        <td>50</td>
                    </tr>
                    <tr>
                        <td>Eve</td>
                        <td>Jackson</td>
                        <td>94</td>
                    </tr>
                </table>

            </div>
        );
    }
}

export default Test

Keywords

FAQs

Package last updated on 15 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc