Jump to content

Display resuls like this with different color?


$php_mysql$

Recommended Posts

can someone show me how is this done like on the forum topic resuls here, one row is red and then other is green?

 

i want fields like this

 

image  title  type  date

 

i want one row to be different color and other to be different.

 

i have taken a screen shot of forum here, hope someone can help me?

 

[attachment deleted by admin]

Link to comment
Share on other sites

Basically each table cell/row is given a different background colour with css. A simple example

 

<style type="text/css">
.odd {
    background-color: #e7eaef;
}
.even {
    background-color: #cacdd3;
}
</style>

<table border="0" cellpadding="5" cellspacing="1">
  <tr>
    <td class="odd">xxx</td>
    <td class="even">xxx</td>
    <td class="odd">xxxx</td>
    <td class="even">xxx</td>
  </tr>
  <tr>
    <td class="odd">xxx</td>
    <td class="even">xxxx</td>
    <td class="odd">xxx</td>
    <td class="even">xxx</td>
  </tr>
  <tr>
    <td class="odd">xxxx</td>
    <td class="even">xxxx</td>
    <td class="odd">xxxx</td>
    <td class="even">xxxx</td>
  </tr>
</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.