PHP inlcudes into an auto colour chnaging table?

If you had a table, where, by js, css and crons, the table rows were auto changing colours (striped), and you wanted all of the rows of that table to be included from another website by PHP includes, how would you personally do it please? I have tried a few attempts at it, and when it’s an ordinary table, the rows change colours with no problems, but as soon as you try to do PHP includes into it, the colouring isn’t working! Any ideas how you get round that one please?

Thanks.

Dez.

I… am not following your description at all, i’m afraid. Is there an example you can show me? Or code?

None at the moment, but just trying to see how this could be done really. you can auto change the colors of rows via css and js, but then, when you view a page that is as a result of php includes, the colors then go back to their original color.

Basically, is there a way of having the tbody of a table coming from another website via a php include AND having some of the table rows automatically change their colors for the striping effect please?

Any help appreciated.

Dez

Javascript and PHP operate in two entirely different spheres, so using includes has no effect on javascript at all.

Without having seen the code, theres not much we can suggest.

Using the zebra striping effect, it changes the table rows, but, if some of those table rows are coming in from another website, via a php include, it then loses the zebra affect.

Just wondering if anyone here, especially those very familiar with the zebra effect have found a way to get round this?

Perhaps something from the include has a similar id/class that could disrupt your js/css. Another guess since nothing else has been provided.

Thanks, but no class’s or id’s are in the tbody. Anyone familiar with the zebra way of styling table rows here?

I’m just trying to figure out how it’s so hard to give us a code sample?
You’ve got the code, you said yourself you’ve done it. Show us it.

Then you obviously need to recheck the posts, I never said I had done it!

Anyone familiar with the zebra way of styling table rows here?

“None at the moment, but just trying to see how this could be done really. you can auto change the colors of rows via css and js, but then, when you view a page that is as a result of php includes, the colors then go back to their original color.”

Which… says to me “There exists a page which this code runs on”… because in order to know that it doesnt work, you have to have had a page in which it has done so.

Unless you’re just absolutely GUESSING that the page wont work, in which case you’re asking about a problem you dont have.

In either case, i’m done with this thread until you actually have a page you’re trying to fix.

You seem confused! I know from experience, that the zebra effect combined with php includes don’t work, so am trying to see if anyone here knows of a way around it - quite simple really!

My point is - TRY IT YOURSELF FIRST. stop asking about a problem that you dont have because you havent tried it and gotten stuck on it. TRY it, and if it doesnt work, THEN come ask questions about why it doesnt work. You’re assuming it’s not going to work based on… seeing something sometime that you cant see the code to and are unable to reproduce.

Assuming you’re talking about standard js (and not AJAX), I can guarantee that the problem is NOT PHP. Period. They work in completely different runtimes. By the time JS sees the code, it’s static HTML. Same as any other page in the world.

As StarLion said, though, PHP operates on the server, so JS just sees the final product and operates on that, includes or not. So the JS zebra striping won’t be affected by includes. Rather than assume you will have problems, just give it a go, and then if there are problems, we can look at why. :wink:

My point is - IS THAT IT WOULDN’T WORK! I tried it a few years ago, and it just wouldn’t! But, no worries, time to move on!

Thanks Ralph - best to leave this! Thanks anyway :thumbsup:

… nuff said.

Have now found a solution - thank you to all those that were helpful!

Did the new solution involve using CSS instead?
http://www.w3.org/Style/Examples/007/evenodd.en.html