body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin: 0;
background-color: #f4f4f4;
padding: 20px;
}
.content {
max-width: 800px;
width: 100%;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1, h2 {
text-align: center;
}
h2 {
margin-top: 10px;
font-size: 20px;
}
.calculator {
margin-top: 20px;
}
label {
display: block;
margin: 10px 0 5px;
}
input {
width: 100%;
padding: 8px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
width: 100%;
padding: 10px;
background-color: #007bff;
border: none;
border-radius: 4px;
color: white;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
font-size: 18px;
}
Tile Quantity Calculator
Prepared By: Parag Kamlakar Pal – Owner of www.civilnotess.com
Example Calculation:
To calculate the number of floor tiles required for a room, follow these steps:
- Room Dimensions: Length = 5 meters, Width = 4 meters
- Tile Dimensions: Length = 0.3 meters, Width = 0.3 meters
- Calculate Total Area: 5 meters × 4 meters = 20 square meters
- Calculate Tile Area: 0.3 meters × 0.3 meters = 0.09 square meters
- Number of Tiles Required: 20 / 0.09 ≈ 222.22 tiles (round up to 223 tiles)
- Include Wastage (10%): 223 × 1.10 ≈ 245.3 tiles (round up to 246 tiles)
Tile Quantity Calculator:
function calculateTiles() {
// Get values from the form
const length = parseFloat(document.getElementById(‘length’).value);
const width = parseFloat(document.getElementById(‘width’).value);
const tileLength = parseFloat(document.getElementById(’tileLength’).value);
const tileWidth = parseFloat(document.getElementById(’tileWidth’).value);
const wastage = parseFloat(document.getElementById(‘wastage’).value) / 100;
// Validate inputs
if (isNaN(length) || isNaN(width) || isNaN(tileLength) || isNaN(tileWidth) || isNaN(wastage)) {
document.getElementById(‘result’).innerText = ‘Please enter valid numbers for all fields.’;
return;
}
// Calculate total area and tile area
const totalArea = length * width;
const tileArea = tileLength * tileWidth;
// Calculate number of tiles needed
let numberOfTiles = totalArea / tileArea;
// Account for wastage
numberOfTiles *= (1 + wastage);
// Round up to the next whole number
numberOfTiles = Math.ceil(numberOfTiles);
// Display the result
document.getElementById(‘result’).innerText = `Number of tiles required (including wastage): ${numberOfTiles}`;
}

