ali_2kool2002 Posted March 29, 2007 Share Posted March 29, 2007 Hi im not sure how to change this line of code in html so that i can use it for my tables to change color when a user puts their mouse curser on. This code below works in html but when iv tried to use it in php but doesnt work...? can someone help me convert the html to pho HTML CODE WORKIN IN <TD> TAG <td>onMouseover="this.bgColor='lightgrey'" onMouseout="this.bgColor='#FFFFFF'"</td> I need to somehow use the above to work on this PHP line below which has a variable in the table <td align="center">' . $results['driver_status'] . '</td> Thanks for anyone who can crack it in php thanks!! Link to comment https://forums.phpfreaks.com/topic/44782-solved-tables-from-html-in-php/ Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 You have to escape the single quotes in your html when you are echoing them in a php statement enclosed in single quotes.... echo '<td onMouseover="this.bgColor=\'lightgrey\'" onMouseout="this.bgColor=\'#FFFFFF\'">' . $results['driver_status'] . '</td> Link to comment https://forums.phpfreaks.com/topic/44782-solved-tables-from-html-in-php/#findComment-217426 Share on other sites More sharing options...
monk.e.boy Posted March 29, 2007 Share Posted March 29, 2007 I think you change the background-color using CSS :hover? True? monk.e.boy Link to comment https://forums.phpfreaks.com/topic/44782-solved-tables-from-html-in-php/#findComment-217441 Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 The css ":hover" pseudo class will not work in IE except on anchor tags. Link to comment https://forums.phpfreaks.com/topic/44782-solved-tables-from-html-in-php/#findComment-217444 Share on other sites More sharing options...
ali_2kool2002 Posted March 29, 2007 Author Share Posted March 29, 2007 hit mans worked !! cheers Link to comment https://forums.phpfreaks.com/topic/44782-solved-tables-from-html-in-php/#findComment-217448 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.