I'm making a node express website, for the news page I'm using data from news api (https://newsapi.org/) The data does appear on the page but it won't respond to CSS flexbox accordingly. My intention was, each news-row
will look like a box containing image, headline, and brief content and the boxes should go like this :
box box box box
box box box box
box box box box
With the Scss below boxes appears like this:
box
box
box
box
box
//scss file
.news-container {
background-color: $light-background;
.news-tb {
width: 350px;
display: flex;
.news-row {
display: flex;
flex-direction: column;
}
}
}
//ejs file
<div class="news-container">
<table class="news-tb">
<% for(var i = 0; i < data.articles.length; i++) { %>
<tr class="news-row">
<td class="news-img"><img src="<%= data.articles[i].urlToImage %>"/></td>
<td class="news-title"><%= data.articles[i].title %></td>
<td class="news-content"><%= data.articles[i].content %></td>
</tr>
<% } %>
</table>
</div>