Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4th column name missing #28

Open
nhammad opened this issue Jun 21, 2021 · 1 comment
Open

4th column name missing #28

nhammad opened this issue Jun 21, 2021 · 1 comment

Comments

@nhammad
Copy link

nhammad commented Jun 21, 2021

I am trying to use this:

        <OutTable data={rows ? rows : []} columns={cols ? cols : []} tableClassName="ExcelTable2007" tableHeaderRowClass="heading" />

to read a file that has 4 column. It shows me my col names/letters till D including the index but for my last column, it doesn't show the column title or a letter at the top. Can this be fixed?

@YakimchykNadzeya
Copy link

YakimchykNadzeya commented Nov 18, 2021

A workaround is to add an empty column:

renderFile = (fileObj) => {
    //just pass the fileObj as parameter
    ExcelRenderer(fileObj, (err, resp) => {

        const columns = [{name: '', key: 0}];
        resp.cols.map(item => {
            columns.push({name: item.name, key: item.key + 1});
            return null;
        })

        if (err) {
            console.log(err);
        } else {
            this.setState({
                dataLoaded: true,
                cols: columns,
                rows: resp.rows
            });
        }
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants