# Display row markers in tables not just the data grid

**URL:** <https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185>\
**Category:** Ask for Help\
**Created:** [April 4, 2025, 2:15pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185 "2025-04-04T14:15:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carl\_Johnson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carl_johnson/32/75656_2.png) [@Carl\_Johnson](https://community.glideapps.com/u/Carl_Johnson)\
**Post date:** [April 4, 2025, 2:15pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/1 "2025-04-04T14:15:06Z")

</div>

I have a table that ranks teams based on their score. I would like to display the row marker value in the table view like the data grid currently does.

example where rank is dynamically generated in the table view like the data grid

_rank_ team score  
1 red 500  
2 blue 480  
3. green 100

Any ideas?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 4, 2025, 4:51pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/2 "2025-04-04T16:51:12Z")

</div>

I would use use case number 2 in the following post, but use a sorted query instead of a relation.

> [@How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572):
>
> This is a question that comes up a lot, so creating this topic to use as a reference. Typically, there are two distinct use cases when it comes to auto-incrementing row numbers. Use Case 1: – We need to generate a Part Number, or an Order Number, or an Employee ID. Once the number is generated, it should never change, even if rows are deleted. – The general approach for this use case is to maintain a static counter, use it to craft a suitably formatted ID, and increment it by one every time…

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 5, 2025, 5:14am UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/3 "2025-04-05T05:14:51Z")

</div>

Do you need to account for ties?

---

<div class="post-metadata">

**Author:** ![Carl\_Johnson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carl_johnson/32/75656_2.png) [@Carl\_Johnson](https://community.glideapps.com/u/Carl_Johnson)\
**Post date:** [April 5, 2025, 5:10pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/4 "2025-04-05T17:10:58Z")

</div>

i don’t need to populate auto-incremented rows numbers in columns. I only want to _display_ ranking when the table is sorted - just like the data grid currently does. But I want to use a table to avoid enabling data entry.

if entry 3 is now the top score it will be listed in the first row of the collection viewer.

and YES - I do need to account for ties.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 6, 2025, 12:30am UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/5 "2025-04-06T00:30:01Z")

</div>

I used JavaScript for a use case like this recently.

```auto
function getRank(clicksJoined, clicksCount) {
    // Split the joined clicks string into an array of numbers
    const clicksArray = clicksJoined.split(', ').map(Number);

    // Sort the clicks array in descending order
    clicksArray.sort((a, b) => b - a);

    // Initialize rank and previous click count
    let rank = 1;
    let previousCount = clicksArray[0];

    // Iterate through the sorted clicks array to determine the rank
    for (let i = 1; i < clicksArray.length; i++) {
        if (clicksArray[i] < previousCount) {
            rank = i + 1;
            previousCount = clicksArray[i];
        }
        if (clicksArray[i] === clicksCount) {
            return rank;
        }
    }

    // If the clicksCount is the highest, return 1
    if (clicksCount === clicksArray[0]) {
        return 1;
    }

    // If the clicksCount is not found in the array, return -1 (indicating not ranked)
    return -1;
}

return getRank(p1, p2)

```

p1: Comma-delimited list of all “scores”  
p2: Current row’s score

 ![CleanShot 2025-04-06 at 07.29.34](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/4/0438bdbcc4dd243b8dceda1f748ff719f6ff5f0a.jpeg)

Gets something like this.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 6, 2025, 12:35am UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/6 "2025-04-06T00:35:35Z")

</div>

> [@Carl\_Johnson](#):
>
> I only want to _display_ ranking when the table is sorted

Do you mean by clicking the table column headers? I don’t believe that is possible.

> [@ThinhDinh](#):
>
> I used JavaScript for a use case like this recently.

That’s cheating 😛  
I used 8 computed columns, haha

 ![CleanShot 2025-04-06 at 08.34.11@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/3/735c1b9b7ad1512d5b53584a6078965b6cc506b0.jpeg)

---

<div class="post-metadata">

**Author:** ![Carl\_Johnson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carl_johnson/32/75656_2.png) [@Carl\_Johnson](https://community.glideapps.com/u/Carl_Johnson)\
**Post date:** [April 8, 2025, 12:18pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/7 "2025-04-08T12:18:57Z")

</div>

looks like this is just what i need. thanks.

foirst time embedded js in a glide app for me. is this post the one to use?

> [@Web Embed Component](https://community.glideapps.com/t/web-embed-component/54463/4):
>
> Create a text column and place your code in that column cell, OR create a template column and put that code in as the template value. The goal is to get your code into one or many cells within your table. Then create a javascript column and put in the code that I included in my previous post. Set the replacement value for p1 to point to the column that contains YOUR code. That should be it. Point the web embed component to that javascript column and hopefully it should work. In theory, it …

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 8, 2025, 1:36pm UTC](https://community.glideapps.com/t/display-row-markers-in-tables-not-just-the-data-grid/81185/8 "2025-04-08T13:36:57Z")

</div>

If you use my JS, it’s in the JavaScript column in the data view to calculate the rank, and not something you embed.
