本文主要是介绍画一个一行三列的表格,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
画一个一行三列的表格
const arr=["425364","090723","675582","564997","223334","406950","641849","536738","970166","598150","319214","426455","491063","369031","719871","075796","538433","383611","955195","984389","198770","070483","201612","775307","045404"
]
首先将数组分为二维数组,每小组3个
const result = []
for (let i = 0; i < arr.length; i += 3) {result.push(arr.slice(i, i + 3))
}
<table border="1"><tr v-for="row in result"><td v-for="col in row">{{ col }}</td></tr>
</table>
这篇关于画一个一行三列的表格的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!