Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:06:35+00:00 2026-06-03T20:06:35+00:00

I am wondering how to change this : This code is using a table

  • 0

I am wondering how to change this :

This code is using a table and I instead trying to use a div, but I wanna define the div the same way it’s done with enter <td>. In <td class= '".$class." thum'> here
Like enter <div class='".$class." thumb'> here

enter <td ' class='".$class." thumb'><div align='center'><a href='show-".$row['id'].".php'><img src='".$row['image']."' width='80' height='60' /></a></div></td> here

I am trying to change color on each iteration of loop. That’s what $class is there.

I don’t think this is clear at all. It’s hard to explain it

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:06:38+00:00Added an answer on June 3, 2026 at 8:06 pm

    You could define a new value within each loop prior to echoing the output. For instance, if you wanted “zebra stripes,” you could check if the current iteration is even or odd:

    for ( $i = 0; $i < count( $items ); $i++ ) {
      $style = ( $i % 2 == 0 ) ? $styleA : $styleB ;
      echo "<td class='{$style} thumb'>...</td>";
    }
    

    Sample Output: http://codepad.org/8cYyiBBH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there is a way, using PHP, to change this date
I am trying to use this library that allows for inline table editing, and
I'm wondering why the height in percentage is not working in this code: <div
I've had this problem a few times and solved it the same way. But
I was wondering if there is a way to programmatically change a stopgradient color
I'm writing code this week to dynamically change the color of images. As long
I was wondering how to change input values when using the Entity Framework. Till
From what I understand by using code like this: NSURL* appUrl = [NSURL URLWithString:
I'm wondering how to change the blue highlight/selection color of a UITableViewCell , any
I was wondering - is it possible to change files that are stored on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.