PDA

View Full Version : Replace cells with span.



Erindesign
Jan 18th, 2007, 12:11 AM
I have a structure constructed from tables (which is what it should be. It really is tabular data.) Unfortunately, I cannot make the whole row a link (from what I know at least). So, I decided to use spans instead.

i have something like this:


<table width="100%" cellpadding="0" cellspacing="0">
<tr><td width="200">cell 1</td><td width="100">cell 2</td><td width="30">Cell 3</td></tr>
...
...
</table>


Now, I can convert to just using one cell per row and instead use spans for the cells to be as place holders in order to keep that straight look that a table would. My whole point is to make the whole row a link (allowing me to use effects on the whole row. I tried just using spans but they wouldn't lign up, be all screwed up and when they did lighn up they would cross over, skip lines and all sorts of problems. My Css skills are horrible, so: Any help please?

Thanks, Erind

felgall
Jan 18th, 2007, 12:21 AM
Perhaps something like this:

<tr><td><span style="width:200px;display:block;float:left">cell 1</span><span style="width:100px;display:block;float:left">cell 2</span><span style="width:30px;display:block;float:left">Cell 3</span></td></tr>

moving the styles into a stylesheet and using classes would be the next step if it works for what you want to do.

Erindesign
Jan 18th, 2007, 01:03 AM
Got it, Thanks.


(i really need to focus on css. even simple things stomp me)

rmedek
Jan 18th, 2007, 04:43 AM
My whole point is to make the whole row a link (allowing me to use effects on the whole row.

If you're looking to style a table row you could always target the state of the table row:


tr:hover {
background: #eee;
}

…and then use a javascript like this one (http://www.htmldog.com/articles/suckerfish/dropdowns/) to get it working in IE.

Erindesign
Jan 18th, 2007, 05:42 PM
Can you display tr as block, and then apply tr.row a:link, tr.row a:active, tr.row a:hover, tr.row a:visited?

(i got it to work by using spans but just wondering if that will work with trs. i know it works with tds.)