This is a class assignment isn't it?
Think about it a moment. You have three arrays, one array corresponds to the x axis of your table (the branches array with 6 entries), one array corresponds to the y axis of your table (the month array with 12 entries) and the third array corresponds to both (the sales array with 6 time 12 or 72 entries).
The table you output apparently needs to show the "branches" heading at the top and the months along the side. It would be assumed that the first six entries in the "sales" array are the sales for each of those six branches for the month of January and the next six entries in the array are the sales for those same six branches for the month of February....
For each month's data in the sales array you need to output an opening <tr> tag, then the table cell with the month's name followed by the table cells showing the sales for each of the six branches for that month followed by a total for all branches for that month and then the the closing </tr> tag.
Once all the months have been display you need to display an accumulation total for the years sales for each branch, you can either add an additional array and add the sales for each branch to the right entry in the array
Your original code simply displayed the branches heading line (which is right) but then ran down the months and displayed each month in a new row but didn't display the sales data or total for that month. Not intil you got to the end do you display the sales data and then you do it all at once where the totals should be instead.
Check out the Forum Search
. It's the short path to getting great results from this forum.