dez — 2011-09-13T15:10:51-04:00 — #1
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?
starlion — 2011-09-13T15:12:54-04:00 — #2
I... am not following your description at all, i'm afraid. Is there an example you can show me? Or code?
dez — 2011-09-15T06:30:25-04:00 — #3
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.
starlion — 2011-09-15T06:34:04-04:00 — #4
Without having seen the code, theres not much we can suggest.
dez — 2011-09-15T06:51:46-04:00 — #5
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?
centered_effect — 2011-09-15T07:07:32-04:00 — #6
Perhaps something from the include has a similar id/class that could disrupt your js/css. Another guess since nothing else has been provided.
dez — 2011-09-15T07:12:44-04:00 — #7
Thanks, but no class's or id's are in the tbody. Anyone familiar with the zebra way of styling table rows here?
starlion — 2011-09-15T08:35:48-04:00 — #8
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.
dez — 2011-09-15T08:40:58-04:00 — #9
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?
starlion — 2011-09-15T08:44:37-04:00 — #10
"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.
dez — 2011-09-15T08:51:35-04:00 — #11
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!
starlion — 2011-09-15T08:57:08-04:00 — #12
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.
ralphm — 2011-09-15T08:59:49-04:00 — #13
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.
dez — 2011-09-15T09:00:29-04:00 — #14
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!
dez — 2011-09-15T09:01:26-04:00 — #15
Thanks Ralph - best to leave this! Thanks anyway
starlion — 2011-09-15T09:28:58-04:00 — #16
... nuff said.
dez — 2011-09-15T12:46:25-04:00 — #17
Have now found a solution - thank you to all those that were helpful!
paul_wilkins — 2011-09-15T17:33:15-04:00 — #18
Did the new solution involve using CSS instead?