Header Ads

Here is a simple calculator HTML code that you can use on your website:

 Here is a simple calculator HTML code that you can use on your website:






<!DOCTYPE html> <html> <head> <title>Simple Calculator</title> <style type="text/css"> table { margin: auto; border-collapse: collapse; width: 50%; text-align: center; font-family: Arial, sans-serif; font-size: 18px; border: 1px solid #ccc; } th { background-color: #f2f2f2; padding: 8px; border: 1px solid #ccc; } td { padding: 8px; border: 1px solid #ccc; } input[type="button"] { background-color: #4CAF50; color: white; border: none; padding: 8px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } input[type="text"] { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; margin-top: 6px; margin-bottom: 16px; font-size: 18px; text-align: right; } </style> </head> <body> <table> <tr> <th colspan="4">Simple Calculator</th> </tr> <tr> <td colspan="4"><input type="text" id="result" readonly></td> </tr> <tr> <td><input type="button" value="1" onclick="display(1)"></td> <td><input type="button" value="2" onclick="display(2)"></td> <td><input type="button" value="3" onclick="display(3)"></td> <td><input type="button" value="/" onclick="display('/')"></td> </tr> <tr> <td><input type="button" value="4" onclick="display(4)"></td> <td><input type="button" value="5" onclick="display(5)"></td> <td><input type="button" value="6" onclick="display(6)"></td> <td><input type="button" value="*" onclick="display('*')"></td> </tr> <tr> <td><input type="button" value="7" onclick="display(7)"></td> <td><input type="button" value="8" onclick="display(8)"></td> <td><input type="button" value="9" onclick="display(9)"></td> <td><input type="button" value="-" onclick="display('-')"></td> </tr> <tr> <td><input type="button" value="." onclick="display('.')"></td> <td><input type="button" value="0" onclick="display(0)"></td> <td><input type="button" value="C" onclick="clearResult()"></td> <td><input type="button" value="+" onclick="display('+')"></td> </tr> <tr> <td colspan="4"><input type="button" value="="


No comments

Powered by Blogger.