• We have events once a month. I have a query that displays the events for a particular year and city in a single table but it is too long vertically as it basically shows 12 rows in one column.

    I would like to have the table horizontally instead of vertically so that only 3 rows show and the rest goes in more columns ie if only 3 events it only shows one column, if you have 6 events then it shows 2 columns etc. Sorry about the bad formatting but you get the idea hopefully.

    January….April…July
    February…May…..August
    March……June….September

    instead of

    January
    February
    March
    April
    June etc

    I am not good enough to figure out how to tell php to switch to another tr after it counts 3 results and would very much appreciate a little help in changing this code to add a count and some </tr><tr> somewhere

    <td valign="top">
    <?php query_posts('category_name=Chicago&year=2010&order=DES'); ?>
    
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <a href="<?php the_permalink(); ?>">
      <?php the_title(); ?><?php the_date(" Y") ?></a>
      <?php endwhile; else: ?>
    <?php endif; ?>
      <?php wp_reset_query(); ?></td>

The topic ‘Query results shown in horizontal table’ is closed to new replies.