Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- IE 7,8 quirks mode - advanced selectors work around


SuzyUK - 8:40 am on Jul 5, 2011 (gmt 0)


this is yuk.. (using IE expressions!) but may be an option for you?

Using cellIndex [msdn.microsoft.com] as a means to get unique identifier, with the 'td' added because classes shouldn't start with a number..


in the css file..

.DataColBill td { /* IE only */
behavior: expression(
this.className = 'td' + cellIndex,
this.style.behavior = null
);
}

.DataColBill .td1 {color: blue;}


it produces HTML like this..

<TD class=DataColBill><TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="BEHAVIOR: null" class=td0><!--x_first_name.val-->Foo<!--end--></TD>
<TD style="BEHAVIOR: null" class=td1 align=right>&nbsp;&nbsp;Last Name: &nbsp;</TD>
<TD style="BEHAVIOR: null" class=td2><!--x_last_name.val-->Bar<!--end--></TD></TR></TBODY></TABLE></TD>


so you can actually target all the cells in that particular table, if there is already classnames on those cells (which I'm presuming not or this question wouldn't arise) you can add the class using
this.className += ' td' + cellIndex, - the null style is to stop the behavior repeatedly calling


Thread source:: http://www.webmasterworld.com/css/4334732.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com