• Resolved BestResearch

    (@bestresearch)


    I have a table that needs to be three columns across, and sorted alphabetically. Periodically, I’ll have to add and remove items from it. Is there a command that will allow me to automatically populate the table from a list of items, or will I have to move around the <tr><\tr> every time I add a new item?
    Thank you for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • you can do this with various loops, depending on what you want this table populated with. Are they wordpress posts?

    Thread Starter BestResearch

    (@bestresearch)

    Thanks for the quick reply. They are icons, each about 250px by 150px.

    okay, where are they kept in your wordpress database? as posts, as media, or are you just straight up linking to random images on the internet. I just need more information to point you in the right direction.

    Thread Starter BestResearch

    (@bestresearch)

    Each of the cells is currently coded like this:
    <!--icon name--><td style="text-align:center;vertical-align:middle;" width="210"><a href="link" target="_blank"><img class="nohover" title="icon name" alt=" " src="image location" width="150" height="90" /><img class="hover" title="icon name" alt=" " src="image location" width=150" height="90" /></a></td>
    Each of the icons, both the regular one and a sepia toned one for the hover image, are kept in the WordPress database.
    Thank you again for your help.

    great, having them in the database makes this very easy.

    WP_Query is probably going to be your savior. http://codex.wordpress.org/Class_Reference/WP_Query

    You can start a table in your html and have each td element spit out by the while loop. This is the most common way to retrieve data from your wordpress database.

    Thread Starter BestResearch

    (@bestresearch)

    Great, thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘populating a table’ is closed to new replies.