aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

Row numbering Excel-style #474

Closed naho2081 closed 7 years ago

naho2081 commented 7 years ago

Is it possible to add numbers to the table rows like this? 1. 2. 3...

Actually it is number of the row in the reactiveTable. If I move to Page 2 (assuming I have 50 rows per page) numbers should continue like this 51. 52. 53..

naho2081 commented 7 years ago

Solved this using CSS. It doesn't take into account pagination but at least rows have numbers.

table
  counter-reset rowNumber
  tbody
    tr
      counter-increment rowNumber
      td
        &:first-child
          &::before
            content counter(rowNumber)
            min-width 1em
            margin-right 1em
aslagle commented 7 years ago

I'm glad you figured something out. I don't think there's a better way to do this unless you store numbers with your data.