我已经写了一个电影推荐和函数将返回这样的东西。我正在寻找远离转换为HTML表和显示为网页使用Python flask
[
{
"id": 601,
"imdb_id": "tt0068646",
"imdb_rating": "9.2",
"language": "English, Italian, Latin",
"poster": "https://m.media-amazon.com/images/M/MV5BM2MyNjYxNmUtYTAwNi00MTYxLWJmNWYtYzZlODY3ZTk3OTFlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg",
"title": "The Godfather",
"year": 1972
},
{
"id": 603,
"imdb_id": "tt0071562",
"imdb_rating": "9.0",
"language": "English, Italian, Spanish, Latin, Sicilian",
"poster": "https://m.media-amazon.com/images/M/MV5BMWMwMGQzZTItY2JlNC00OWZiLWIyMDctNDk2ZDQ2YjRjMWQ0XkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg",
"title": "The Godfather Part II",
"year": 1974
},
{
"id": 622,
"imdb_id": "tt0108052",
"imdb_rating": "9.0",
"language": "English, Hebrew, German, Polish, Latin",
"poster": "https://m.media-amazon.com/images/M/MV5BNDE4OTMxMTctNmRhYy00NWE2LTg3YzItYTk3M2UwOTU5Njg4XkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg",
"title": "Schindler's List",
"year": 1993
}
]
我尝试过json2html,但它根本不起作用
1条答案
按热度按时间vjrehmav1#
我不知道你对
json2html
有什么问题,但这段代码对我很有效。可以使用参数
table_attributes
设置表格样式。如果它仍然不起作用,我给予你这个脚本,但我的建议是库。
如果您需要更多关于json2html here的信息,请参阅文档