使用HTML做一个微行计算器(无计算功能)

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>计算器</title>
</head>
<body>
	<!--定义按键表格,每个按键对应一个事件触发-->
	<table border="1" align="center" bgcolor="darkgrey" style="height: 400px; width: 350px">
	<!--                                                                                         	
               	描述:align="center"  居中
                  bgcolor 背景颜色             -->
	<tr>
		<td colspan="5">	<!--  colspan  跨列数      如0键占横着的两格  rowspan   跨行数     如=键占竖着的两格 -->
		<input type="text" id="nummessege" style="height: 40px; width: 400px; font-size: 50px" />
	</td>
	</tr>
	<tr>
	<td>
		<input type="button" value="MC" id="MC" οnclick="onclicknum('MC')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="MR" id="MR" οnclick="onclicknum('MR')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="MS" id="MS" οnclick="onclicknum('MS')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="M+" id="M+" οnclick="onclicknum('M+')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="M-" id="M-" οnclick="onclicknum('M-')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
        </tr> 
	<tr>
	<td>
		<input type="button" value="←" id="←" οnclick="onclicknum('←')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="CE" id="CE" οnclick="onclicknum('CE')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="C" id="C" οnclick="onclicknum('C')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="±" id="±" οnclick="onclicknum('±')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="√" id="√" οnclick="onclicknum('√')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
        </tr>
	<tr>
	<td>
		<input type="button" value="7" id="7" οnclick="onclicknum('7')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="8" id="8" οnclick="onclicknum('8')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
	<td>
		<input type="button" value="9" id="9" οnclick="onclicknum('9')" style="height: 60px; width: 70px; font-size: 25px">
	</td>
<td> <input type="button" value="/" id="/" οnclick="onclicknum('/')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="%" id="%" οnclick="onclicknum('%')" style="height: 60px; width: 70px; font-size: 25px"> </td> </tr> <tr> <td> <input type="button" value="4" id="4" οnclick="onclicknum('4')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="5" id="5" οnclick="onclicknum('5')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="6" id="6" οnclick="onclicknum('6')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="*" id="*" οnclick="onclicknum('*')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="1/x" id="1/x" οnclick="onclicknum('1/x')" style="height: 60px; width: 70px; font-size: 25px"> </td> </tr> <tr> <td> <input type="button" value="1" id="1" οnclick="onclicknum('1')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="2" id="2" οnclick="onclicknum('2')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="3" id="3" οnclick="onclicknum('3')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="-" id="-" οnclick="onclicknum('-')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td rowspan="2"> <input type="button" value="=" id="=" οnclick="onclicknum('=')" style="height: 120px; width: 70px; font-size: 25px"> </td> </tr> <tr> <td colspan="2"> <input type="button" value="0" id="0" οnclick="onclicknum('0')" style="height: 60px; width: 150px; font-size: 25px"> </td> <td> <input type="button" value="." id="." οnclick="onclicknum('.')" style="height: 60px; width: 70px; font-size: 25px"> </td> <td> <input type="button" value="+" id="+" οnclick="onclicknum('+')" style="height: 60px; width: 70px; font-size: 25px"> </td> </tr> </table> </body></html>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值