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

Documentation and/or Feature Request: Make it easier to learn how to create a "Row Number" column #461

Open
DanKaplanSES opened this issue Jan 30, 2024 · 0 comments

Comments

@DanKaplanSES
Copy link
Contributor

DanKaplanSES commented Jan 30, 2024

For context, console.table provides an "(index)" column:

The first column in the table will be labeled (index). If data is an array, then its values will be the array indices.

console.table is pretty bare-bones, so I think people will find this project while looking for a superset of its functionality. console-table-printer looks like a good match, but the documentation implies that you have to calculate your own "Row Number" or "(index)" column. If that were the case (I know it isn't, but I'll discuss that below), calculating your own "Row Number" or "(index)" column is a nontrivial effort: Each addRow call would need access to a rowCounter variable and the ability to increment it. This has the potential of changing many internal API's of the dependent package.

I believe it's already possible to do this with a Calculated Column, but I didn't find that an obvious place to look. That may be because I assumed I would have to calculate this column on my own before I got to this section. Could an earlier example use a calculated column to create a "Row Number" column?

Alternatively, if the Table API provided a .length or .size() that returned a number, creating a custom "Row Number" or "(index)" column would become straightforward.

@DanKaplanSES DanKaplanSES changed the title Documentation Request: Make it easier to find how to create a "Row Number" column Documentation and/or Feature Request: Make it easier to learn how to create a "Row Number" column Jan 30, 2024
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

1 participant