Script CRUD Javascript!
Berikut adalah script HTMLnya :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CRUD dengan JavaScript</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>CRUD dengan JavaScript</h1>
<form id="form">
<label for="name">Nama:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<label for="phone">Telepon:</label>
<input type="text" id="phone" name="phone">
<button type="submit" id="submit">Simpan</button>
</form>
<table>
<thead>
<tr>
<th>Nama</th>
<th>Email</th>
<th>Telepon</th>
<th>Aksi</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
<script src="script.js"></script>
</body>
</html>
Dan ini cssnya :
body {
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
}
form {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 30px;
}
label {
margin-top: 10px;
}
input[type="text"],
input[type="email"] {
padding: 5px;
margin-left: 10px;
}
button {
padding: 5px 20px;
margin-top: 10px;
background-color: #008CBA;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
table {
margin: auto;
border-collapse: collapse;
}
table th,
table td {
padding: 10px;
border: 1px solid black;
}
table th {
background-color: #008CBA;
color: white;
}
table td:last-child {
text-align: center;
}
table td a {
color: red;
text-decoration: none;
cursor: pointer;
}

Comments
Post a Comment