Rommeo Posted November 24, 2009 Share Posted November 24, 2009 I have many tables as a result of search query.. and tables keeps photos and texts. and I m trying to make the table clickable as you move the cursor anywhere on the table and you will be able to click even for the areas that has no text. Is it possible to do this ? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/ Share on other sites More sharing options...
jcombs_31 Posted November 24, 2009 Share Posted November 24, 2009 You'll have to use a little bit of unobtrusive javascript to do it right. Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-964940 Share on other sites More sharing options...
Rommeo Posted November 24, 2009 Author Share Posted November 24, 2009 You'll have to use a little bit of unobtrusive javascript to do it right. does that way have a name ? ( so I can google it ) I did it by using css actually. But it only works in firefox.. IE always problem. Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-964942 Share on other sites More sharing options...
FaT3oYCG Posted November 24, 2009 Share Posted November 24, 2009 http://gaming-network.ath.cx/tclick.php Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-964954 Share on other sites More sharing options...
FaT3oYCG Posted November 26, 2009 Share Posted November 26, 2009 Page taken down. Code: <table border="1" cellspacing="0" cellpadding="20"> <tr> <td onClick="alert('Item 1 Row 1');">Item 1 Row 1</td> <td onClick="alert('Item 2 Row 1');">Item 2 Row 1</td> </tr> <tr> <td onClick="alert('Item 1 Row 2');">Item 1 Row 2</td> <td onClick="alert('Item 2 Row 2');">Item 2 Row 2</td> </tr> </table> <br> <table border="1" cellspacing="0" cellpadding="15"> <tr onClick="alert('Table 2 Row 1 Click');"> <td>Item 1 Row 1</td> <td>Item 2 Row 1</td> </tr> <tr onClick="alert('Table 2 Row 2 Click');"> <td>Item 1 Row 2</td> <td>Item 2 Row 2</td> </tr> </table> <br> <table border="1" cellspacing="0" cellpadding="10" onClick="alert('Table 3 Click');"> <tr> <td>Item 1 Row 1</td> <td>Item 2 Row 1</td> </tr> <tr> <td>Item 1 Row 2</td> <td>Item 2 Row 2</td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-966033 Share on other sites More sharing options...
Rommeo Posted November 26, 2009 Author Share Posted November 26, 2009 Thank you so much FaT3oYCG Btw can I use more than one line of code here ; onClick="alert('Table 3 Click'); doSomething(somethinghere); anotherFunction();" Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-966102 Share on other sites More sharing options...
FaT3oYCG Posted November 26, 2009 Share Posted November 26, 2009 yes, that is entirley possible or you could create a function in html script tags at the top of the page specifying the javascript type and then just reference the single function that way. If you want to leant javascript then visit w3schhols.com and click the link for Javascript and it will tell you everything that you need to know and more that you dont . Link to comment https://forums.phpfreaks.com/topic/182822-making-a-table-clickable/#findComment-966121 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.