页面如下图所示
实现添加购物车,数量添加、减少,物品删除,计算金额的功能,麻雀虽小五脏俱全。表格用的是layui框架。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Study</title>
<link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
</head>
<style type="text/css">
h1 {
text-align: center;
font-size: 20px;
margin: 40px 0 20px 0;
font-family: "黑体";
font-weight: bolder;
}
.layui-table {
margin: 0 auto;
width: 60%;
border-collapse: collapse;
}
</style>
<body>
<h1>真划算</h1>
<table class="layui-table">
<colgroup>
<col width="150">
<col width="200">
<col>
</colgroup>
<thead>
<tr>