Im trying to create an HTML table (open to other options) capable of doing math across an editable table. This is the code that Ive been working with but Im not sure how to accomplish the task.
<body>
<table border="1">
<tr>
<th colspan="2">Numbers</th>
</tr>
<tr>
<td>Paper</td>
<td><div contenteditable>24</td></div>
</tr>
<tr>
<td>Bits</td>
<td><div contenteditable>0.20</td></div>
<tr>
<td>Resale Value</td>
<td><div contenteditable>2.49</td></div>
</tr>
<tr>
<td>Weekly Change</td>
<td><div>Profit Totals</td></div>
</tr>
</table>
<button type="button">Continue</button>
<p id="Math"></p>
<script>
var Test = 5+5;
document.getElementById("Math").innerHTML = Test;
</script>
</body>
What I need to happen seems to be complex, Ive wrote it down on paper, done the math and wrote down equations but have 0 idea how to input into the code.
These are the equations in order of how they should be performed. 1. 40(paper) * X = Y
X*Y=R
100/A=B
B/X=C
C*S=F
F-R=Z
Z*50(sales per week)=D
VARIABLE MEANINGS
X= Paper (See first table column)
Y= Bits when multiplied by paper
R= Bits value resold
A= Bits value in cents (See second table column)
B= Bits before multiplied by paper
C= Number of paper
S= Resale value of paper (If paper is usually worth $2 but I sell it for $1.5 with changing price as fit)
Z= Total change between F and R
D= Weekly Profits
I want to be able to enter my own values (ex, where it says 24 I want to be able to type 17 and the equation follow suit and show me the result once I hit the "continue" button). I want the math to display the final weekly profits gained in the 4th table named "Weekly Change." I understand this seems confusing but I would appreciate any help offered on this as I do not know very much HTML.
Note, the tag was for testing to see how variables worked with a simple equation on its own (5+5) but has no purpose yet. Same goes with the continue button and does not currently do anything.
Please ask me if I need to explain anything, lots of variables and math Im happy to further detail if needed.
Thanks!!