twig for loop access value using array i have a for loop

{% for row in rows %}
    {{ row.content }}
{% endfor %}


will print out like this

&lt;div&gt; one &lt;/div&gt;
&lt;div&gt; two &lt;/div&gt;
&lt;div&gt; three &lt;/div&gt;
&lt;div&gt; ... &lt;/div&gt;


but what i want to is access the values using a key so i can pull the values individually so i can do some thing like this

&lt;div class="container"&gt;
    &lt;div&gt; one &lt;/div&gt;
&lt;/div&gt;

&lt;div class="second-container"&gt;
    &lt;div&gt; one &lt;/div&gt;
&lt;/div&gt;

&lt;div class="anyclassname"&gt;
    &lt;div&gt; one &lt;/div&gt;
&lt;/div&gt;


basically print the value anywhere i want on a div of my choice. Is it possible ?? please help

this is for a views template
In views-view.html.twig is not appropriate to style your row and fields.

To style them first you need override template "views_view_'format_style'" (format style specified when you edit/create a view). Here you can style row and access 'fields' variables (use kint(row) to see them).

Something like:

{% for row in rows %}
  {%
    set row_classes = [
      default_row_class ? 'views-row',
    ]
  %}
  {{ kint(row) }} {# devel #}
  &lt;h2&gt; {{row.content['#node'].getTitle()}} &lt;/h2&gt; {# access fields #}
  &lt;div{{ row.attributes.addClass(row_classes) }}&gt;
    {{ row.content }}
  &lt;/div&gt;
{% endfor %}


For style fields its better override field template.

For example field--node--body--article.html.twig:

{% set mode = element['#view_mode'] %}
{% if label_hidden %}
  {% for item in items %}
    {% if mode == 'full' %}
        &lt;div{{ attributes }}&gt;{{ item.content }}&lt;/div&gt;
    {% elseif mode == 'teaser' %}
        &lt;p{{ attributes }}&gt;{{ item.content }}&lt;/p&gt;
    {% endif %}
  {% endfor %}
{% else %}
  &lt;div{{ attributes }}&gt;
    &lt;div{{ title_attributes }}&gt;{{ label }}&lt;/div&gt;
    {% for item in items %}
      &lt;div{{ item.attributes }}&gt;{{ item.content }}&lt;/div&gt;
    {% endfor %}
  &lt;/div&gt;
{% endif %}


source : In Drupal 8 view.html.twig file how do I access the view content such as individual field title and/or field content?

http://twig.sensiolabs.org/doc/tags/for.html