How to add a new line using for loop?

I have a simple array of alphabets I use a for loop to display the alphabets on the screen I want to add every sixth letter to a new line I want to achieve this result

enter image description here

<script>
  export default {
    data() {
      return {
        alphabet: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
      }
    }
  }
</script>

<template>
  <ul>
    <li v-for="(item, index) in alphabet" :key="index">
      {{ item }}
    </li>
  </ul>
</template>


Read more here: https://stackoverflow.com/questions/67005819/how-to-add-a-new-line-using-for-loop

Content Attribution

This content was originally published by Synchro at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: