smerny Posted July 28, 2009 Share Posted July 28, 2009 is there a way to make a whole cell or even a whole row or table a link? the closest think i could do is put a link inside of it with display:block... but what if i want text with different properties within it? or multiple rows of text? or text and images? and still want the entire cell to be linked to a certain page? basically i want this <tr><a href...><td>stuff here</td></a></tr> without javascript if possible Link to comment https://forums.phpfreaks.com/topic/167720-make-a-table-cell-a-link/ Share on other sites More sharing options...
haku Posted July 28, 2009 Share Posted July 28, 2009 A whole cell - yes. A whole row - no. You have the right idea on setting the link to be a block, and expanding it to the size of the cell. That will work, and in fact is the only way to do it without using javascript. If you want to have linebreaks and separate styling within the link/cell, you can wrap text in <span> tags, and use <br /> tags. Although really, unless it's tabular data, you shouldn't be using tables anyways. But that's whole different issue. Link to comment https://forums.phpfreaks.com/topic/167720-make-a-table-cell-a-link/#findComment-884547 Share on other sites More sharing options...
smerny Posted July 28, 2009 Author Share Posted July 28, 2009 kinda what i figured, yes it is tubular data and i was going to still use divs, but i wanted it to be dynamic.. with sizes and such for rows/columns Link to comment https://forums.phpfreaks.com/topic/167720-make-a-table-cell-a-link/#findComment-884620 Share on other sites More sharing options...
haku Posted July 28, 2009 Share Posted July 28, 2009 If it's tabular data, then not only is there nothing wrong with using tables, it's actually the correct thing to do, whereas using divs would not be. Link to comment https://forums.phpfreaks.com/topic/167720-make-a-table-cell-a-link/#findComment-884664 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.