Hi this is my first post and I'm quite stuck if I'm honest and I'm relatively new to ASP that being said I am not looking for a simple solution as any complexities will aid in my learning process
Using Jscript in my ASP
Situation:
I have a 2 dimensional array that needs to be printed out into a table.
Array structure:
array[id][monthNumber] = value
My id does not start at 0(it can tho) the first id is in fact 15 monthNumber can be anything within a 4 month period so it can be 4 - 7 or 11 - 2. Value is just a number
Eg array elements:
array[15][8] = 19
array[15][9] = 52
array[15][10] = 14
array[15][11] = 98
array[20][8] = 125
array[20][9] = 254
array[20][10] = 7
array[20][11] = 9
Problem:
I need to display this information like this
Code:
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td>ID</td>
<td>August</td>
<td>September</td>
<td>October</td>
<td>November</td>
</tr>
<tr>
<td>15</td>
<td>19</td>
<td>52</td>
<td>14</td>
<td>98</td>
</tr>
<tr>
<td>20</td>
<td>125</td>
<td>254</td>
<td>7</td>
<td>9</td>
</tr>
</table>
As you can see with the IDs 20 follows 15 so there can be undefined elements. I do have an array with month names in to display the appropriate month name based on the monthNumber element of my array
Code:
var months = new Array();
months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
As I said before the month period can vary from 1 month to a 4 month period
Oh and the table needs to be produced server side
Will appreciate any solutions