MINI-REPEATER 1.03
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
background-color: #ffffff; /* Set a background color for better visibility */
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
}
.mainDiv {
width: calc(100% - 40px); /* 20px margin on each side */
background-color: blue;
border-radius: 10px; /* Optional: Add rounded corners */
padding: 20px;
box-sizing: border-box;
margin-bottom: 20px; /* Add margin between the two mainDivs */
}
.itemDiv {
margin: 5px;
padding: 10px;
border: 1px solid #ccc;
position: relative;
}
.title {
font-weight: bold;
color: white;
}
.idString {
position: absolute;
top: 0;
right: 0;
background-color: #f0f0f0;
padding: 5px;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="container">
<div class="mainDiv" id="mainDiv"></div>
</div>
<script>
const dataArray = [
{ _id: '123', name: 'Anna', age: 30, city: 'ExampleCity', isActive: true },
{ _id: 456, name: 'John', age: 25, city: 'SampleVille', isActive: false },
{ _id: 789, name: 'Alice', age: 35, city: 'Testburg', isActive: true },
{ _id: 101, name: 'Bob', age: 28, city: 'DemoCity', isActive: false },
{ _id: '202', name: 'Eve', age: 40, city:...