budget.js
// adds the expense to the Expenses column

adds the expense to the Expenses column
adds the expense to the Expenses column
function addExpenseToTable() {
           var table = document.getElementById("expensesTable");
           var row = table.insertRow(index_expense);
           row.id = 'row_id'+String(index_expense)
           var cell1 = row.insertCell(0);
           var cell2 = row.insertCell(1); 
           var cell3 = row.insertCell(2); 
           var cell4 = row.insertCell(3);
           cell1.innerHTML = name_expenses[name_expenses.length - 1];
           cell2.innerHTML = sum_expenses[sum_expenses.length - 1];
           cell3.innerHTML = expense_necessity[expense_necessity.length - 1];
           cell4.innerHTML = '<button onclick="removeItemExpense('+String(index_expense)+')">X</button>';
           index_expense += 1;
       }
function addExpenseToTable ( ) { var table = document . getElementById ( "expensesTable" ) ; var row = table . insertRow ( index_expense ) ; row . id = 'row_id' + String ( index_expense ) var cell1 = row . insertCell ( 0 ) ; var cell2 = row . insertCell ( 1 ) ; var cell3 = row . insertCell ( 2 ) ; var cell4 = row . insertCell ( 3 ) ; cell1 . innerHTML = name_expenses [ name_expenses . length - 1 ] ; cell2 . innerHTML = sum_expenses [ sum_expenses . length - 1 ] ; cell3 . innerHTML = expense_necessity [ expense_necessity . length - 1 ] ; cell4 . innerHTML = '<button onclick="removeItemExpense(' + String ( index_expense ) + ')">X</button>' ; index_expense += 1 ; }
adds the expense to the Expenses column
adds the expense to the Expenses column