DEVTOME.COM HOSTING COSTS HAVE BEGUN TO EXCEED 115$ MONTHLY. THE ADMINISTRATION IS NO LONGER ABLE TO HANDLE THE COST WITHOUT ASSISTANCE DUE TO THE RISING COST. THIS HAS BEEN OCCURRING FOR ALMOST A YEAR, BUT WE HAVE BEEN HANDLING IT FROM OUR OWN POCKETS. HOWEVER, WITH LITERALLY NO DONATIONS FOR THE PAST 2+ YEARS IT HAS DEPLETED THE BUDGET IN SHORT ORDER WITH THE INCREASE IN ACTIVITY ON THE SITE IN THE PAST 6 MONTHS. OUR CPU USAGE HAS BECOME TOO HIGH TO REMAIN ON A REASONABLE COSTING PLAN THAT WE COULD MAINTAIN. IF YOU WOULD LIKE TO SUPPORT THE DEVTOME PROJECT AND KEEP THE SITE UP/ALIVE PLEASE DONATE (EVEN IF ITS A SATOSHI) TO OUR DEVCOIN 1M4PCuMXvpWX6LHPkBEf3LJ2z1boZv4EQa OR OUR BTC WALLET 16eqEcqfw4zHUh2znvMcmRzGVwCn7CJLxR TO ALLOW US TO AFFORD THE HOSTING.

THE DEVCOIN AND DEVTOME PROJECTS ARE BOTH VERY IMPORTANT TO THE COMMUNITY. PLEASE CONTRIBUTE TO ITS FURTHER SUCCESS FOR ANOTHER 5 OR MORE YEARS!

HTML Calculator: How to make it

In this article we are going se how you can build calculator using html.

Le's start with basic command you are supposed to know.

Basic Commands

<center>

This text will be center-aligned.

The HTML Center Element (<center>) is a block-level element that can contain

  • paragraphs
  • block-level and inline elements

The entire content of this element is centered horizontally within its containing element.

</center>

End of text center-aligned.

EXAMPLE:

<center>This text will be centered.</center>

In practice:

This text will be centered.

<FORM>

The <form> tag is used to create an HTML form for user input.

<TABLE>

The <table> tag defines an HTML table. An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements.

<tr>

The <tr> element defines a table row.

<th>

The <th> element defines a table header.

<td> The <td> element defines a table cell.

colspan

you can group the inside of the columns in order to have such as a row of columns 2 and 3 from another. To obtain this result it is necessary to specify that a cell must occupy the place of 2 (or columns). In this case, it uses the attribute colspan on <td>, as a value specifying the number of cells that must be occupied. For example:

<TD colspan=2>

border

specifies the width of the edges of a table (in pixels)

cellspacing

specifies the distance (in pixels) between one cell and another, or between a cell and the edge. The default is one pixel, therefore always be necessary to reset it explicitly, when it is not desired

cellpadding

Indicates the distance between the cell content and its border. If the value is indicated with an integer, the distance is expressed in pixels; the cellpadding however can also be expressed in percentage. By default, the distance is zero.

Align

We have the ability to align the mage and the text as we prefer, using the align attribute

The code

 <CENTER>
 <FORM name="Keypad" action="">
 <TABLE>
 <B>
 <TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
 <TR>
 <TD colspan=3 align=middle>
 <input name="ReadOut" type="Text" size=24 value="0" width=100%>
 </TD>
 <TD>
 <TD
 </TD>
 <input name="btnClear" type="Button" value="  C  " onclick="Clear()">
 </TD>
 <TD>
 <input name="btnClearEntry" type="Button" value=" CE  " onclick="ClearEntry()">
 </TD>
 </TR>
 <TR>
 <TD>
 <input name="btnSeven" type="Button" value="  7  " onclick="NumPressed(7)">
 </TD>
 <TD>
 <input name="btnEight" type="Button" value="  8  " onclick="NumPressed(8)">
 </TD>
 <TD>
 <input name="btnNine" type="Button" value="  9  " onclick="NumPressed(9)">
 </TD>
 <TD>
 </TD>
 <TD>
 <input name="btnNeg" type="Button" value=" +/- " onclick="Neg()">
 </TD>
 <TD>
 <input name="btnPercent" type="Button" value="  %  " onclick="Percent()">
 </TD>
 </TR>
 <TR>
 <TD>
 <input name="btnFour" type="Button" value="  4  " onclick="NumPressed(4)">
 </TD>
 <TD>
 <input name="btnFive" type="Button" value="  5  " onclick="NumPressed(5)">
 </TD>
 <TD>
 <input name="btnSix" type="Button" value="  6  " onclick="NumPressed(6)">
 </TD>
 <TD>
 </TD> 
 <TD align=middle>
 <input name="btnPlus" type="Button" value="  +  " onclick="Operation('+')">
 </TD>
 <TD align=middle>
 <input name="btnMinus" type="Button" value="  -  " onclick="Operation('-')">
 </TD>
 </TR>
 <TR>
 <TD>
 <input name="btnOne" type="Button" value="  1  " onclick="NumPressed(1)">
 </TD>
 <TD>
 <input name="btnTwo" type="Button" value="  2  " onclick="NumPressed(2)">
 </TD>
 <TD>
 <input name="btnThree" type="Button" value="  3  " onclick="NumPressed(3)">
 </TD>
 <TD>
 </TD>
 <TD align=middle>
 <input name="btnMultiply" type="Button" value="  *  " onclick="Operation('*')">
 </TD>
 <TD align=middle>
 <input name="btnDivide" type="Button" value="  /  " onclick="Operation('/')">
 </TD>
 </TR>
 <TR>
 <TD>
 <input name="btnZero" type="Button" value="  0  " onclick="NumPressed(0)">
 </TD>
 <TD>
 <input name="btnDecimal" type="Button" value="  .  " onclick="Decimal()">
 </TD>
 <TD>
 <input name="btnEquals" type="Button" value="  =  " onclick="Operation('=')">
 </TD>
 <TD colspan=3>
 </TD>
 </TR>
 </TABLE>
 </TABLE>
 </B>
 </FORM>
 </CENTER>
 <font face="Verdana, Arial, Helvetica" size=2>
 <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
 var FKeyPad = document.Keypad;
 var Accumulate = 0;
 var FlagNewNum = false;
 var PendingOp = "";
 function NumPressed (Num) {
 if (FlagNewNum) {
 FKeyPad.ReadOut.value  = Num;
 FlagNewNum = false;
    }
 else {
 if (FKeyPad.ReadOut.value == "0")
 FKeyPad.ReadOut.value = Num;
 else
 FKeyPad.ReadOut.value += Num;
    }
 }
 function Operation (Op) {
 var Readout = FKeyPad.ReadOut.value;
 if (FlagNewNum && PendingOp != "=");
 else
 {
 FlagNewNum = true;
 if ( '+' == PendingOp )
 Accumulate += parseFloat(Readout);
 else if ( '-' == PendingOp )
 Accumulate -= parseFloat(Readout);
 else if ( '/' == PendingOp )
 Accumulate /= parseFloat(Readout);
 else if ( '*' == PendingOp )
 Accumulate *= parseFloat(Readout);
 else
 Accumulate = parseFloat(Readout);
 FKeyPad.ReadOut.value = Accumulate;
 PendingOp = Op;
    }
 }
 function Decimal () {
 var curReadOut = FKeyPad.ReadOut.value;
 if (FlagNewNum) {
 curReadOut = "0.";
 FlagNewNum = false;
    }
 else
 {
 if (curReadOut.indexOf(".") == -1)
 curReadOut += ".";
    }
 FKeyPad.ReadOut.value = curReadOut;
 }
 function ClearEntry () {
 FKeyPad.ReadOut.value = "0";
 FlagNewNum = true;
 }
 function Clear () {
 Accumulate = 0;
 PendingOp = "";
 ClearEntry();
 }
 function Neg () {
 FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;
 }
 function Percent () {
 FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accumulate);
 }
 // End -->
 </SCRIPT>

In Practice


 

Advertise with Anonymous Ads