简体   繁体   English

如何在html表格中显示数据?

[英]how to display data in html table?

I have object like this: my object我有这样的对象:我的对象

and I would like to display this data in html table.我想在 html 表中显示这些数据。 I get all this values by this:我通过这个得到所有这些值:

Object.entries(this.state.urls).forEach(([property, value]) => {
  console.log(value)
})

and now it looks like: current state现在它看起来像:当前状态

how to put all this elements to one table ?如何将所有这些元素放在一张桌子上?

It seems this.state.urls is an array of arrays and you want to merge all the url's in each array into 1 array.似乎this.state.urls是一个数组数组,您希望将每个数组中的所有 url 合并为 1 个数组。

Try following尝试以下

var urls = [].concat.apply([], this.state.urls); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM