Hi,
I found a script to do I wanted, but there is a problem;
the “ypslon” must starting always in ‘1’, but zpslon must starting after
ypson value + 2 (must have an interval of ‘1’
In this way the values, for example, must be, for example:
left
1 2 3 4
right
6 7 8 9
or
left
1 2 3 4 5
right
7 8 9 10 11 12
or yet
left
1 2 3 4 5 6
right
8 9 10
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE=”JavaScript”>
function createLinks()
{
var count = document.getElementById(“ypslon”).value;
var sHTML = “”;
var ypslon=0;
var zpslon=0;
for(var x=0;x<count;x++)
{
sHTML += ‘<a href=”#” onclick=”concatColumn(‘ + (x+1) + ‘);return false”>Column ‘ + (x+1) + ‘</a><BR>’;
}
document.getElementById(“tdLinks”).innerHTML = sHTML;
}
</script>
<script>
function createLinks2(theForm){
var count2 = document.getElementById(“zpslon”).value;
var x=0;
var sHTML2 = “”;
ypslon = document.getElementById(“ypslon”).value;
var count2 = count2 * 2;
for(var x2=ypslon;x2<count2;x2++)
{
sHTML2 += ‘<a href=”#” onclick=”concatColumn(‘ + (x2+1) + ‘);return false”>Column ‘ + (x2+1) + ‘</a><BR>’;
}
document.getElementById(“tdLinks2”).innerHTML = sHTML2;
}
</SCRIPT>
<script type=”text/javascript”>
function concatColumn(colIndex){
var tableObj = document.getElementById(‘myTable’);
var string = ”;
var wordFrequency = new Array();
var wordArray = new Array();
colIndex–;
for(var no=0;no<tableObj.rows.length;no++){
var word = tableObj.rows[no].cells[colIndex].innerHTML;
if(!wordFrequency[word]){
wordFrequency[word]=1;
wordArray.push(word);
}else wordFrequency[word]++;
}
var string = ‘<table border=”1″><tr><th>Word</th><th>Frequency</th></tr>’;
for(var no=1;no<wordArray.length;no++){
string+='<tr><td>’+wordArray[no]+'</td><td>’+wordFrequency[wordArray[no]]+'</td></tr>’;
}
string+='</table>’;
document.getElementById(‘resultDiv’).innerHTML = string;
}
</script>
</head>
<body>
<form>
<textarea name=”t1″ rows=5 cols=50>
</textarea><br>
<INPUT NAME=”ypslon” TYPE=”text” value=”” size=2 textwidth=2><LABEL FOR=user>left</LABEL>
<INPUT NAME=”zpslon” TYPE=”text” value=”” size=2 textwidth=2><LABEL FOR=user>right</LABEL>
<INPUT TYPE=”BUTTON” onClick=”createLinks();” VALUE=”Left”>
<INPUT TYPE=”BUTTON” onClick=”createLinks2();” VALUE=”Right”>
<br><div id=”t2″></div>
<div id=”resultDiv”></div>
<TABLE>
<TR>
<TD ID=”tdLinks”></TD>
</TR>
<TR>
<TD ID=”tdLinks2″></TD>
</TR>
</TABLE>
</form>
</body>
</html>
Thank you in advance
Letchev