How can I determine the first displayed
line (or nth line, for that matter) of text
in an a given element? It can be assumed
that the element has a fixed width (such
as a DIV in a TD with a fixed column width).
Thanks for any tips,
Csaba Gabor from New York
I'm on IE 5.5
e.g.
<BODY onLoad="alert('The first line is: '+calcLine(1))">
<SCRIPT language=javascript type='text/javascript'>
function calcLine(lineNum) {
return ("line " + lineNum + " needs work")
}
</SCRIPT>
<TABLE>
<TR>
<TD style="width:1in"><DIV>
This line is so long that it will wrap a few times
</DIV></TD>
</TR>
</TABLE>
</BODY>