Jump to content

[SOLVED] <table> to be a link


web_master

Recommended Posts

Hi,

 

how can I do to a full <table></table> be a link:

 

<table>
<tr>
  <td>some text</td>
  </td>
</tr>
</table>

 

mean, that user can click everywhere in a table, all area in table will be a link...

 

I think like this:

 

<a href="#">
<table>
<tr>
  <td>some text</td>
  </td>
</tr>
</table>
</a>

 

is that a right way?

 

thankx

 

web_master

Link to comment
https://forums.phpfreaks.com/topic/80150-solved-to-be-a-link/
Share on other sites

Not a PHP question...but you can do it with JavaScript.

 

<script language="javascript">

function link(url){
   window.location = url
}

</script>

<table border=1 onclick="link('http://www.google.com')">
<tr>
   <td>Blah blah blah</td>
</tr>
<tr>
   <td>Blah blah blah</td>
</tr>
<tr>
   <td>Blah blah blah</td>
</tr>
</table>

Link to comment
https://forums.phpfreaks.com/topic/80150-solved-to-be-a-link/#findComment-406199
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.