HTML: Writing Mathematical Equations

There are few techniques for coding mathematical expressions in html. I am giving out some of them here. We can make use of <sub> and <sup> tags to write simple equations containing powers(squares, qubes) and numbered constants. Here is an example for such equation: a1x2+b2x+c3 = 0
a<sub>1</sub>x<sup>2</sup>+b<sub>2</sub>x+c<sub>3</sub> = 0
For Squres and qubes , you can use &sup2; and &sup3; codes instead of using <sub> tags. Moving on to Fractions, we face problem in arrage numerator and denominators in required position. This can be solved if you make use of html tables. For Example

y = x.tanθ - gx²


The above formula is purely written in HTML using table. Source Code:

Note: In HTML, in some cases, such as in tables, no closing tags are required.

No comments:

Post a Comment

Thank you for commenting. Please keep visiting.