Hello. I have a table that is populated with the information from a 2-D array. The latest problem I am having is getting the table to change dynamically. It does change, but it isn't how I expect it to. Here is my problem.

Say i have an array that looks like this
{"hello", 0}
{"goodbye", 1}

this is the original array. I have a drop down menu in HTML that will change the order of the table based on a certain numeric row. What i do is make a new array with the data from the original, and sort that Array. Here is how I determine how to sort the array:

Code:
function fetchData(){
		selectMenu = document.getElementById("selectMenu");
		value = selectMenu.value;
		var holder = full_array;//full_array is the original array
		var full_array2 = full_array;//ignore this variable, from before
		
		if (value == "populate"){
			fill_table(old_array);//old_array is full array, set when full_array is set. I have tried using full_array in its place to no avail
			return;
		}
		if (value == "sort"){
			fill_table(holder.sort(value_sort));
			return;
		}
		if (value == "sort1"){
			fill_table(holder.sort(value_sort1));
		}
		if (value == "sort2"){
			fill_table(holder.sort(value_sort2));
		}

	}
value_sort 0-2 all pretty much look the same, but sort by different columns.

The full_table function looks like the following:

Code:
function fill_table(fullarray){
		var k = 1;
		var string = "";
		for(i = 0; i < fullarray.length; i++){
            string += "<tr>";
			string +=  "<td>" + (i + 1) + "</td>";
            string +=  "<td>";
            string +=  fullarray[i][0];
            string +=  "</td>";

            string +=  "<td>";
            string +=  fullarray[i][1];
            string +=  "</td>";

            string +=  "<td>";
            string +=  fullarray[i][2];
            string +=  "</td>";

            string +=  "<td>";
            string +=  fullarray[i][3];
            string +=  "</td>";

            string +=  "<td>";
            string +=  fullarray[i][4];
            string +=  "</td>";
            
            string +=  "<td " + fullarray[i][6]+ ">";
            string +=  fullarray[i][5] + "%";
            string +=  "</td>";

            string +=  "</tr>";
			k++;
		}
		div = document.getElementById("table");
		html = div.innerHTML
		div.innerHTML = regdata + string;
	
	}
This function WORKS to some extent. For every option but the first (to put the original, raw data from my database to the table) it works. When I try the first option first, it works. but every time after that it does not. It also does not work if I do another option first, then try it.

I believe it has something to do with the sorts, but I don't see how sorting one array with the same data will affect a different array. Anyone have any ideas?