Giter Site home page Giter Site logo

coston / react-super-responsive-table Goto Github PK

View Code? Open in Web Editor NEW
419.0 11.0 50.0 9.17 MB

Turn the tables on unresponsive data!

Home Page: https://react-super-responsive-table.vercel.app

License: MIT License

JavaScript 87.63% CSS 12.37%
react data-visualization responsive-design tables

react-super-responsive-table's Introduction

react-super-responsive-table

Coverage Status npm downloads code style: prettier

react-super-responsive-table converts your table data to a user-friendly list in mobile view.

Demo

Demo Gif

Live demo: https://react-super-responsive-table.vercel.app/

Installation

npm install react-super-responsive-table --save

Usage

  1. import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table'
  2. Copy or import react-super-responsive-table/dist/SuperResponsiveTableStyle.css into your project
  3. Write your html table with the imported components.
import React from 'react';
import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table';
import 'react-super-responsive-table/dist/SuperResponsiveTableStyle.css';

export default function TableExample(props) {
  return (
    <Table>
      <Thead>
        <Tr>
          <Th>Event</Th>
          <Th>Date</Th>
          <Th>Location</Th>
        </Tr>
      </Thead>
      <Tbody>
        <Tr>
          <Td>Tablescon</Td>
          <Td>9 April 2019</Td>
          <Td>East Annex</Td>
        </Tr>
        <Tr>
          <Td>Capstone Data</Td>
          <Td>19 May 2019</Td>
          <Td>205 Gorgas</Td>
        </Tr>
        <Tr>
          <Td>Tuscaloosa D3</Td>
          <Td>29 June 2019</Td>
          <Td>Github</Td>
        </Tr>
      </Tbody>
    </Table>
  );
}

Using Dynamic Headers

Headers are statefully stored on first render of the table, since the library doesn't use props for them and just checks the children of the thead to build its internal list of headers upon construction. To use dynamic headers, use a key prop to ensure the components are all internally updated when you're making this kind of change.

<Table key={i}>
  <Thead>
    <Tr>
      <Th>{headers[0]}</Th>
      <Th>{headers[1]}</Th>
    </Tr>
  </Thead>
  <Tbody>
    <Tr>
      <Td>item 1</Td>
      <Td>item 2</Td>
    </Tr>
  </Tbody>
</Table>

Contributors

Super Responsive Tables are made possible by these great community members:

Contributing

Please help turn the tables on unresponsive data! Submit an issue and/or make a pull request. Check the projects board for tasks to do.

License

Licensed under the MIT license.

react-super-responsive-table's People

Contributors

alexandra-c avatar brycehanscomb avatar coston avatar dependabot[bot] avatar dragos-rosca avatar galacemiguel avatar greenkeeper[bot] avatar jasonphillips avatar jorrit avatar juhq avatar luizeboli avatar nshahri avatar picchikevin avatar renovate-bot avatar renovate[bot] avatar thiagotakehana avatar wedvich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-super-responsive-table's Issues

Not able to use conditional column

Issue:
It is not possible to use conditional columns:
{false && <Td>Column</td>}

Error:

Uncaught Error: React.cloneElement(...): The argument must be a React element, but you passed null.
    at invariant (:3000/static/js/vendors.chunk.js:50842)
    at Object.cloneElement (:3000/static/js/vendors.chunk.js:158017)
    at Object.cloneElementWithValidation [as cloneElement] (:3000/static/js/vendors.chunk.js:158886)
    at :3000/static/js/vendors.chunk.js:142170
    at mapSingleChildIntoContext (:3000/static/js/vendors.chunk.js:158347)

Fix:
#62

Use a different boilerplate module

react-component-gulp-tasks seems unmaintained and doesn't work with Node 8. Maybe use a different boilerplate module for compability with new Node versions and Javascript syntax?

Render falsy variables

Describe the bug
Using variable with falsy value equal to zero renders &nbsp instead of zero.

To Reproduce

Code:

  const stats = 0;
  <Td>{stats}</Td>

Results:

<td><div class="tdBefore">Stats</div><div>&nbsp;</div></td>

Expected behavior

<td><div class="tdBefore">Stats</div>0</td>

An in-range update of mdx-go is breaking the build 🚨

The devDependency mdx-go was updated from 1.1.9 to 1.1.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mdx-go is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.8.3 to 7.8.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Half of the rows are not visible.

Describe the bug
Half of the rows are not visible. happening with every alternate row.
Only happening on ios devices.
Works fine with every other device.

To Reproduce
Steps to reproduce the behavior:

  1. Can be reproduced by using this library in any ios device

Expected behavior
All rows should be visible.

Screenshots

GIF

Smartphone (please complete the following information):

  • Device: all ios devices
  • OS: ios 13
  • Browser: safari,chrome
  • Version: @latest

THead not working with react-table hooks.

Thead Showing Error
I am trying to integrate react-super-responsive-table with the help of react-table hook,
It is showing error :

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    at createFiberFromTypeAndProp

When I use htlm thead tag it works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Intergrate super responsive table and react-table together.

Add css class for mobile view

It would be great to add eg is-mobile class when table is in mobile view, it would help to style table for each responsive modes

Overflow (suggestion)

I see that the overflow of content inside cells is not dealt with.

I propose a prop called "wordBreak" (BOOLEAN) to be introduced for the "Td" and "Th" components which would dynamically add style property: word-break:break-all;

feat: add <Tfoot> functionality

It could be really useful to have a prop to set a different column name for a single row.

Let's take as example this table:

Product Quantity Price
Item 1 1 5 $
Item 2 3 7 $
Item 3 2 3 $
Total 6 15 $

When pivoting it, I get the Total row mixed up, like:

  • Product: Total
  • Quantity: 6
  • Price: 15 $

I'd love to have the ability to:

  • Exclude a certain column for a single row (in this case, the Product one)
  • Give a custom label to a column in a single row (in this case, Total items and Total price)

Idally this would become, just for the pivoted view:


  • Product: Item 1
  • Quantity: 1
  • Price: 5 $

  • Product: Item 2
  • Quantity: 3
  • Price: 7 $

  • Product: Item 3
  • Quantity: 2
  • Price: 3 $

  • Total items: 6
  • Total price: 15 $

Thead Invariant Violation Dynamic Data

Hi,

I have a table where I don't know how many columns there will be until the table is rendered. I receive the following error:

Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    at invariant (http://localhost/static/js/1.chunk.js:45401:19)
    at createFiberFromTypeAndProps (http://localhost/static/js/1.chunk.js:55995:15)
    at createFiberFromElement (http://localhost/static/js/1.chunk.js:56015:19)
    at reconcileSingleElement (http://localhost/static/js/1.chunk.js:58382:27)
    at reconcileChildFibers (http://localhost/static/js/1.chunk.js:58442:39)
    at reconcileChildren (http://localhost/static/js/1.chunk.js:60306:32)
    at updateHostComponent (http://localhost/static/js/1.chunk.js:60790:7)

The above error occurred in the <thead> component:
    in thead (created by Thead)
    in Thead (at Table.js:139)

My code is:

      <Table {...getTableProps()} className='table table-striped table-hover'>
        <Thead>{headerGroups.map((h, i) => {
              <Tr>
                <Th>{i}</Th>
              </Tr>
        })

        }
        </Thead>
        <Tbody>
          {page.map(
            (row, i) => {
              console.log(row)
              return prepareRow(row) || (
                <Tr {...row.getRowProps()} className={!row.original.isViewed ? 'unviewed' : ''}>
                  {row.cells.map(cell => {
                    return (
                      <Td {...cell.getCellProps()}>{cell.render('Cell')}</Td>
                    )
                  })}
                </Tr>
              )}
          )}
        </Tbody>
      </Table>

I am using this along with react-table. The suggestions on the ReadMe for dynamic header titles seems related to my issue, but it hasn't provided me with any clues.

Prevent header column to repeate on every row

I have a checkbox in table header to select all checkboxes in the rows. How can I prevent, that this checkbox will be also repeat on every row?
<th dontRepeat><Checkbox id={'check-all-tasks'} onClick={checkAll} color='primary'/></th>

An in-range update of react is breaking the build 🚨

There have been updates to the react monorepoundefined

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the react group definition.

react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v16.5.2

React DOM

Schedule (Experimental)

  • Renaming "tracking" API to "tracing" (@bvaughn in #13641)
  • Add UMD production+profiling entry points (@bvaughn in #13642)
  • Refactored schedule to remove some React-isms and improve performance for when deferred updates time out (@acdlite in #13582)
FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Ability to Set the Breakpoint

Is your feature request related to a problem? Please describe.
I have tables with many columns and I'd like to be able to pass in a breakpoint so that the table will respond to larger sized view ports. So for tablet I would still like to show the responsive table.
Describe the solution you'd like
Ability to pass a prop into the Table component with the breakpoint size.

Describe alternatives you've considered
I tried overriding the CSS but the headers were not working. I am assuming there is code that updates the elements based on viewport size

Additional context

React does not recognize the `columnKey` prop on a DOM element.

Currently getting the following error output when using your library with React v16.2.0

It appears in your code as columnKey but should be spelt all lowercase to avoid the error. Has anyone else come across this?

Warning: React does not recognize the `columnKey` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `columnkey` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in th (at health-service-results.jsx:18)
    in tr (created by TrInner)
    in TrInner (created by WithContext(TrInner))
    in WithContext(TrInner) (at health-service-results.jsx:17)
    in thead (created by Thead)
    in Thead (at health-service-results.jsx:16)
    in table (created by Table)
    in ProvideContext (created by Table)
    in Table (at health-service-results.jsx:15)
    in div (at health-service-results.jsx:8)
    in div (at health-service-results.jsx:7)
    in HealthServiceResults (at health-checks.jsx:125)
    in div (at health-checks.jsx:163)
    in HealthChecks (created by Route)
    in Route (created by withRouter(HealthChecks))
    in withRouter(HealthChecks) (at App.jsx:103)
    in Route (at App.jsx:103)
    in Switch (at App.jsx:96)
    in ScrollToTop (created by Route)
    in Route (created by withRouter(ScrollToTop))
    in withRouter(ScrollToTop) (at App.jsx:95)
    in div (at App.jsx:91)
    in div (at App.jsx:80)
    in Router (created by BrowserRouter)
    in BrowserRouter (at App.jsx:79)
    in App (at index.js:12)

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

add index.d.ts typescript definitions

Create default file index.d.ts with typescript definition exporting interfaces and methods.
With definition is easier to add on ts project and we do not receive warnings anymore.

image

If owners want to add, I can work on it.

Table header is not responsive

Describe the bug
The table header is not responsive when having a column with no data. This causes the columns to overlap.

To Reproduce
Add a column with no data.

Screenshots
image

Custom breaking points

Custom breaking points to define where should become display block along with .

For eg: If someone want to transition from Table view to card view when screen size is < 700px .
Currently it set to 40em @media screen and (max-width: 40em) , even after changing it item remains hidden.

make a table not a function so we can use popular libs as react-table

Is your feature request related to a problem? Please describe.
A table is a an alternative to the html version <table>.

Sadly, react-super-responsive-table has functions as well. Most people use a popular library called 'react-table' to setup filter, sorting, rendering of cell data. The beauty of React-table is it doesn't do anything with the actual "rendering" of a table. So I can use Semantic Ui React table without any fuzz. Sadly I couldn't use your library that easy. Could you make an alternative where you don't have to set states or variations ?

Describe the solution you'd like
Use react-super-responsive-table to render a responsive table inside react-table.

Describe alternatives you've considered
Could you consider making it work with react-table. I think it will increase this libraries popularity

Additional context
Code this isn't working

import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table';
import 'react-super-responsive-table/dist/SuperResponsiveTableStyle.css';
...
<Table {...getTableProps()}>
        <Thead>
          {headerGroups.map((headerGroup) => (
            <Tr {...headerGroup.getHeaderGroupProps()}>
              {headerGroup.headers.map((column) => (
                <Th {...column.getHeaderProps()}>
                  <div>
                    <span {...column.getSortByToggleProps()}>
                      {column.render("Header")}
                      {/* Add a sort direction indicator */}
                      {column.isSorted
                        ? column.isSortedDesc
                          ? " 🔽"
                          : " 🔼"
                        : ""}
                    </span>
                  </div>
                </Th>
              ))}
            </Tr>
          ))}
        </Thead>
        <Tbody {...getTableBodyProps()}>
          {page.map((row) => {
            prepareRow(row);
            return (
              <Tr {...row.getRowProps()}>
                {row.cells.map((cell) => (
                  <Td {...cell.getCellProps()}>
                    {cell.render("Cell")}
                  </Td>
                ))}
              </Tr>
            );
          })}
        </Tbody>

Code that is working fine```

import { Pagination, Table } from "semantic-ui-react";
...
<Table {...getTableProps()}>
        <Table.Header>
          {headerGroups.map((headerGroup) => (
            <Table.Row {...headerGroup.getHeaderGroupProps()}>
              {headerGroup.headers.map((column) => (
                <Table.HeaderCell {...column.getHeaderProps()}>
                  <div>
                    <span {...column.getSortByToggleProps()}>
                      {column.render("Header")}
                      {/* Add a sort direction indicator */}
                      {column.isSorted
                        ? column.isSortedDesc
                          ? " 🔽"
                          : " 🔼"
                        : ""}
                    </span>
                  </div>
                </Table.HeaderCell>
              ))}
            </Table.Row>
          ))}
        </Table.Header>
        <Table.Body {...getTableBodyProps()}>
          {page.map((row) => {
            prepareRow(row);
            return (
              <Table.Row {...row.getRowProps()}>
                {row.cells.map((cell) => (
                  <Table.Cell {...cell.getCellProps()}>{cell.render("Cell")}</Table.Cell>
                ))}
              </Table.Row>
            );
          })}
        </Table.Body>
        {/** Shows NoResult component if data is missing. */}
        {page.length === 0 && <SearchNoResult type="table" />}
      </Table>

Table header is not responsive

Describe the bug
Table looks broken when you have long labels in table header.

To Reproduce
Try to render following table:

<Table>
  <Thead>
    <Tr>
      <Th>Very loooooooooooooooooooooooooooooong label</Th>
      <Th>Very loooooooooooooooooooooooooooooong label</Th>
    </Tr>
  </Thead>
  <Tbody>
    {
      [0,1,2,3,4].map(() => {
        return(
          <Tr>
            <Td>testing values testing values testing values testing values </Td>
            <Td>testing values testing values testing values testing values </Td>
          </Tr>
        )
      })
    }
  </Tbody>
</Table>

Expected behavior
I am expecting to get the same behaviour as <td> tag for <th>, so when there is no enough space, the line should break into multiple lines.

Screenshots
table

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: Chrome
  • Version: 74.0.3729.169

Warning: Unknown prop `columnKey` on <th> tag.

Warning: Unknown prop `columnKey` on <th> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in th (created by Th)
    in Th (created by ...)
    in tr (created by TrInner)
    in TrInner (created by Unknown)
    in Unknown (created by ...)
    in thead (created by Thead)
    in Thead (created by ...)
    in table (created by Table)
    in Unknown (created by Table)
    in Table (created by ...)
<Table>
            <Thead>
              <Tr>
                <Th>we</Th>
                <Th>ss</Th>
              </Tr>
            </Thead>
          </Table>

Unknown props `inHeader`, `responsiveTable` on <tr> tag.

Warning: Unknown props `inHeader`, `responsiveTable` on <tr> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
    in tr (created by TrInner)
    in TrInner (created by Unknown)
    in Unknown (created by ...)
    in thead (created by Thead)
    in Thead (created by ...)
    in table (created by Table)
    in Unknown (created by Table)
    in Table (created by ...)
    ...

code:

<Table>
            <Thead>
              <Tr>
                <Th>some text</Th>
                <Th>test</Th>
              </Tr>
            </Thead>
          </Table>

Error when there is only one column in table

When there is only one column in Tr it will throw the following exception.
props.children is not array in this case.

new TrInner
node_modules/react-super-responsive-table/dist/SuperResponsiveTable.js:103
  100 | var headers = props.responsiveTable.headers;
  101 | 
  102 | if (headers && props.inHeader) {
> 103 |   props.children.map(function (child, i) {
      | ^  104 |     headers[i] = child.props.children;
  105 |   });
  106 | }

Fix:
#60

Dynamic Header

Hello,

I don't really understand how to use dynamic headers. I am trying to integrate my headers for the table like this:

    <Thead>
      <Tr>
        <Th></Th>
        {headers.map((header, i) => (
          <Th key={i} className={classes.headCell}>
            {header}
          </Th>
        ))}
      </Tr>
    </Thead>

However, when I check the headers for small devices, the first 2 headers are the only ones shown.

Thanks for your attention, I really like this project.

array `key` property

I'm trying to iterate through an array of items with <Tr> but when I set a key property on <Tr>

<div>
{
this.state.users.map((user,index)=>{
                    return <Tr key={index}>  ...  </Tr>;
})
}
</div>

I have following error:
Warning: Unknown props `inHeader`, `responsiveTable` on <tr> tag. Remove these props from the element
and
Warning: Unknown prop `columnKey` on <th> tag. Remove this prop from the element.

When there is no key react will complain
Each child in an array or iterator should have a unique "key" prop.

Make <TR> a Link in Responsive

Is your feature request related to a problem? Please describe.
Hello ! I would like to make my table clickable, even for the duplicated <th>, in responsive. Currently I can only make the <Td> be Link, but not the <Th>.

Describe the solution you'd like
It would be great if we could setup a parameter to make the hole line clickable in responsive, or even in desktop.

Describe alternatives you've considered
I did put <Link> in all my <Td> to not break CSS. It works in responsive but the left part of the table, with column title, is not clickable.

Additional context
Thank you for your work, it's great to use !

Edit : added tags

onClick does not function on small viewports as well as on desktops when screen size is less than 800 px

onClick handlers do not fire ( nor the cursor transition) at 800 px or less.
I am only showing a portion of the code. Here you can see two onClick handlers. They function great above 800 px in desktop browsers chrome, edge etc., At 800 px and above I see Theads are on top (horizontal row). Below 800 px the Thead is vertical and goes as first column, that is when the onClicks do not function.

      <Thead>
        <Tr>
          <Th>Image</Th>
          <Th onClick={this.doSortByName} className="cur-pointer" scope="col">Name</Th>
          <Th>Phone</Th>
          <Th>Email</Th>
          <Th onClick={this.doSortByDOB} className="cur-pointer" scope="col">DOB</Th>
        </Tr>
      </Thead>

It also does not work on mobile devices since the screen width is less than 800 px. I built my student app using react and used the react-super-responsive-table. Other than this issue, the table is pretty responsive.

rowSpan Property

I needed to add "rowSpan" to my <Td> component and it didn't work. Then I looked over the code and saw that the "colSpan" attribute is being considered and when this is sent to the component all the other props are also sent to the html <td> component.

This means that if I use <Td rowSpan={2}>[...]</Td> the "rowSpan" attribute will get ignored but if I use something like <Td colSpan={1} rowSpan={2}>[...]</Td> my "rowSpan" attribute will be passed to the html <td> component and I will get my desired functionality.

Can you please pass the props to the html <td> component when there is no "colSpan" involved?

class TdInner extends React.Component {
  render() {
    if (this.props.colSpan) {
      return <td {...allowed(this.props)} />
    }
    const { headers, children, columnKey } = this.props
    const classes = (this.props.className || '') + ' pivoted'
    return (
      <td className={classes} {...allowed(this.props)}> {/*<<=== Here I added the props */}
        <div className="tdBefore">{headers[columnKey]}</div>
        {children || <div>&nbsp;</div>}
      </td>
    )
  }
}

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency @testing-library/react to v15.0.3
  • chore(deps): update dependency @commitlint/cli to v19.3.0
  • chore(deps): update actions/setup-node action to v4

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update babel packages to v7.24.5 (@babel/cli, @babel/core, @babel/eslint-parser, @babel/preset-env)
  • chore(deps): update nextjs monorepo to v14.2.3 (@next/eslint-plugin-next, next)
  • chore(deps): update react packages to v18.3.1 (react, react-dom, react-test-renderer)
  • chore(deps): update actions/checkout action to v4

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/nodejs-ci.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @babel/cli 7.24.1
  • @babel/core 7.24.4
  • @babel/plugin-transform-runtime 7.24.3
  • @babel/plugin-transform-spread 7.24.1
  • @babel/preset-env 7.24.4
  • @babel/preset-react 7.24.1
  • @commitlint/cli 19.2.2
  • @commitlint/config-conventional 19.2.2
  • @next/eslint-plugin-next ^14.0.0
  • @testing-library/jest-dom 6.4.2
  • @testing-library/react 15.0.2
  • @babel/eslint-parser 7.24.1
  • babel-jest 29.7.0
  • coveralls 3.1.1
  • eslint 8.57.0
  • eslint-config-airbnb 19.0.4
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jsx-a11y 6.8.0
  • eslint-plugin-prettier 5.1.3
  • eslint-plugin-react 7.34.1
  • eslint-plugin-react-hooks 4.6.0
  • husky 9.0.11
  • identity-obj-proxy 3.0.0
  • jest 29.7.0
  • jest-environment-jsdom 29.7.0
  • lint-staged 15.2.2
  • next 14.2.2
  • prettier 3.2.5
  • prop-types 15.8.1
  • react 18.2.0
  • react-dom 18.2.0
  • react-pkg-demo ^0.1.8
  • react-test-renderer 18.2.0
  • react-window-ui 2.2.0
  • rimraf 5.0.5
  • styled-components 6.1.8
  • prop-types >= 15
  • react >=16.9.0
  • react-dom >=16.9.0
  • node >=12
travis
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Prop to set custom breakpoint

Is your feature request related to a problem? Please describe.
My table's layout is breaking before the media query styles kick in and reflow the content.

Describe the solution you'd like
Given that all tables will vary in content, I think it would be useful to accept a prop to determine when to shift the layout of the table as opposed to setting a universal breakpoint for all.

Describe alternatives you've considered
I can override the styles or choose not import the stylesheet and create my own, but neither are very clean alternatives. Both options would require copying chunks of CSS from the stylesheet just to get started.

Additional context
This was already brought up in #122, but it was self-closed by the issue author, so I'm opening a new issue.

Unknown Prop "columnKey"

Hey there! Great component. Am really hoping I could get some help fixing this issue as it seems to be throwing an error.

Warning: Unknown prop columnKey on <td> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop

in td (created by Unknown) in tr (created by TrInner) in TrInner (created by Unknown) in Unknown (created by Unknown) in tbody (created by Tbody) in Tbody (created by Unknown) in Unknown (created by ConnectedFieldArray) in ConnectedFieldArray (created by Connect(ConnectedFieldArray)) in Connect(ConnectedFieldArray) (created by FieldArray) in FieldArray (created by Form) in table (created by Table) in Unknown (created by Table) in Table (created by Form) in div (created by FieldWrapper) in FieldWrapper (created by Form) in div (created by Form) in div (created by Wrapper) in Wrapper (created by Form) in form (created by Form) in Form (created by Form(Form)) in Form(Form) (created by Connect(Form(Form))) in Connect(Form(Form)) (created by ReduxForm)

I took a look through the code and saw your handy pick method that picks out safe props for elements (sneaky!). Some how I think ReduxForm is adding columnKey in.

Headers disappearing when table pivots at breakpoint

Describe the bug
I have a table with five columns; displays just fine when the display is wide. When the display "flips", the column values are properly displayed but where the column headers should be, there is empty space.
To Reproduce
Trying to set up a codeSandbox to show the behavior...
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Wide display:
image
Narrow Display:
image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser [e.g. chrome, safari] Tested in both Chrome (Version 89.0.4389.128 (Official Build) (x86_64)
    and Safari (Version 14.0 (15610.1.28.1.9, 15610))
  • Version [e.g. 22]

Smartphone (please complete the following information):
N/A

Additional context
Add any other context about the problem here.

Mobile view headers not updating

After the first render if the text of < Th > is changed it will update the desktop view but not the mobile view. Some of my header elements are dynamically changed and when they are updated there is a mismatch between desktop and mobile view.

headers-not-updated-state-not-updated

missmatch-headers

Support <tfoot>

It would be nice to support the tag for tables with summarizing rows. Any plans for that?

Dynamic Table Data

Is your feature request related to a problem? Please describe.
The component does not seem to work with dynamic creation of tables. I tried on a static table with no issues.
Describe the solution you'd like
Ability to use dynamic data tables

Describe alternatives you've considered

Additional context

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Wrapper Ability?

Is your feature request related to a problem? Please describe.

Yes, Having to use the inbuilt components, there used to be a JQuery Lib (Stacktable) where you used to just give it the table element and it would work out the rest from there.

Describe the solution you'd like

With using React I think we could do similar to that where we can build a wrapper component something like <AutoTableWrapper>...</AutoTableWrapper> and that would search the children for a table element.

Additional context

The reason i need a solution like this is we have an admin system that allows people to add tables inside a WYSIWYG editor and we want to be able to stack them for mobile users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.