How can i display post loop in table format?

I am creating a comparison table and the issue is in while loop i am not able to put the “tr” in proper place. I need layout like this

<table>
<tr>
<td>post title 1</td>
<td>post title 2</td>
<td>post title 3</td>
</tr>
<tr>
<td>post content 1</td>
<td>post content 2</td>
<td>post content 3</td>
</tr>
<tr>
<td>post author 1</td>
<td>post author 2</td>
<td>post author 3</td>
</tr>
</table>

How can i achieve that it’s seems like no option see my code below

<div class=”acadp”>
<table>
<tr>
<?php while( $acadp_query->have_posts() ) : $acadp_query->the_post(); ?>
<td><?php the_title(); ?></td>
<td><?php the_content(); ?></td>
<td><?php the_author(); ?></td>
<?php endwhile; ?>
<tr>

</table>
</div>

<?php wp_reset_postdata(); ?>

Read more here:: How can i display post loop in table format?

Leave a Reply

Your email address will not be published. Required fields are marked *