question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to show aggregation statistics data in table

See original GitHub issue

Version

2.9.1

Environment

browser

Reproduction link

http://none

Steps to reproduce

I wanna to show aggregation statistics at Table footer, I am tryings following ways:

  1. using footer prop, add tr and td to it
      <Table
        dataSource={dataSource}
        footer={() => {
          return (
            <tr className='ant-table-row  ant-table-row-level-0'>
              <td>总计</td>
              <td>总计</td>
            <td>总计</td>
            </tr>
          )
        }}
      />
  1. add extra data in dataSource prop
dataSource.push({id: '总计', price: '3000'})

What is expected?

A picture is worth a thousand words:

What is actually happening?

  1. using footer prop, But the footer prop is not fit the table tbody.

  2. add extra data in dataSource prop, But if the dataSource length is over the pageSize , the extra data will be ignored.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:78 (22 by maintainers)

github_iconTop GitHub Comments

51reactions
yesmeckcommented, Apr 12, 2017

Hello @TangMonk, it seems that you are requesting a feature than reporting a bug, I’m afraid we don’t have plan to implement this feature. You can disable table’s default pagination and implement pagination by yourself.

29reactions
yesmeckcommented, Feb 27, 2018

After thinking a while for the tfoot API, I’d like to add it to column property:

const columns = [{
  title: 'Age',
  dataIndex: 'age',
  key: 'age',
  footer: (data) => {
    return <div>Summary: {data.reduce((sum, record) => sum + record.age, 0)}</div>
  },
}, {
  title: 'Name',
  dataIndex: 'name',
  key: 'name',
}, {
  title: 'Address',
  dataIndex: 'address',
  key: 'address',
}];

renders

screen shot 2018-02-27 at 15 03 33
Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Aggregation Explained + Use Cases | Coupler.io Blog
Data aggregation lets you take a bird's-eye view of all the data your business is gathering. Learn how you can set it up...
Read more >
Data Aggregation in Tableau
In Tableau, you can aggregate measures or dimensions, though it is more common to aggregate measures. Whenever you add a measure to your...
Read more >
Data aggregation - IBM
Data aggregation is the process where raw data is gathered and expressed in a summary form for statistical analysis.
Read more >
Aggregate data from a column (Power Query)
Using Power Query, you can aggregate one or more columns of a related table. For example, you can aggregate the sum of order...
Read more >
Efficient aggregation (and more) using data.table
This is a very important aspect of the data.table syntax. Last but not least as implied by the fact that both the aggregating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found