jb60606 Posted July 27, 2007 Share Posted July 27, 2007 does anyone know a row highlighting technique that will work with CSS tables. I need the rows highlighted on a mouse rollover, or atleast a mouse click event. Is this even possible? An AJAX script i've obtained uses a CSS table to organize it's data via multiple "<DIV>" tags. I've since configured the script to retrieve data from a mySQL database and it has become increasingly difficult to distinguish one line of data from the next, even with static row coloring. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/61962-css-table-highlight-a-row-on-rollover-or-click-etc/ Share on other sites More sharing options...
ToonMariner Posted July 27, 2007 Share Posted July 27, 2007 data should be in tables not div tags - see if you can remove the divs... tr:hover { ... } is what you are after BUT this won't work in IE6 - for that you will need to use js and the onmouseover event handler in the tr tag to set different backgrounds etc. Link to comment https://forums.phpfreaks.com/topic/61962-css-table-highlight-a-row-on-rollover-or-click-etc/#findComment-308688 Share on other sites More sharing options...
jb60606 Posted July 27, 2007 Author Share Posted July 27, 2007 Thanks, I figured as much. I've tried replacing the DIV tags with TR/TD tags, etc, though, with the way the Javascript outputs the data, it screwed up the formatting. It's a third party script that I paid for, so I may have to ask/pay them to write a custom script. Thanks Link to comment https://forums.phpfreaks.com/topic/61962-css-table-highlight-a-row-on-rollover-or-click-etc/#findComment-308805 Share on other sites More sharing options...
dbrimlow Posted July 27, 2007 Share Posted July 27, 2007 Try by creating a link class as follows (using whatever colors your site uses) in your css: .row a:link, .row a:visited {display:block; background-color:#FFFFFF, color:#000000} .row a:link, .row a:active{display:block; background-color:#000000, color:#FFFFFF} Now, in your markup, for each row you want to have a hover effect give it a class and blank link: <span class="row"><a href="#">your row data</a></span> This should work if you have already properly listed your main link tags - a:link, a:visited, a:hover, a:active Dave Link to comment https://forums.phpfreaks.com/topic/61962-css-table-highlight-a-row-on-rollover-or-click-etc/#findComment-309204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.