Line Numbers in Card (glance)

i use glance card for display battery management data
is there a easy way to add line numbers to that
i´ve tried to extract the number out of the entity name, and use this, but failed to use template in card
like {{ states.sensor.ecs_cell_12_v.attributes.friendly_name.split(‘_’)[2] }}

The easiest way to achieve it - markdown.

ok thats a way - but i looking for line-numbers :wink:

line numbers you can add in markdown.

sorry didn´t kown
thank you i try that

type: markdown
content: >-
  No | attribute | value
   ---|---|---
  {% for ATTR in states.sun.sun.attributes -%}
  {{loop.index}} | {{ATTR}} | {{state_attr('sun.sun',ATTR)}}

  {% endfor %}

image

Then could be “prettified” by card-mod (grid, borders, etc).

can i loop on part of sensor names (id)? when i have sensor.cell_1 to cell_x) i want to make a loop on the number

{% for i in range(1,x) %}
{{loop.index}} | {{state.sensor.cell_(loop.index)}}
{% endfor %}