0% found this document useful (0 votes)
6 views3 pages

Crypto Prices Table with Search Function

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Crypto Prices Table with Search Function

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Crypto Table Code (HTML, CSS, JavaScript)

HTML Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crypto Prices</title>
<link rel="stylesheet" href="[Link]">
</head>
<body>
<div class="container">
<h2>Search cryptocurrencies</h2>
<input type="text" id="search" placeholder="Search..." onkeyup="searchTable()">

<table id="cryptoTable">
<thead>
<tr>
<th>Logo</th>
<th>Name</th>
<th>Symbol</th>
<th>Price</th>
<th>Price Change</th>
<th>24h Volume</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="[Link] alt="BTC" class="logo"></td>
<td>Bitcoin</td>
<td>BTC</td>
<td>$83,372.29369502033</td>
<td class="red">-1.18%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="ETH" class="logo"></td>
<td>Ethereum</td>
<td>ETH</td>
<td>$1,896.2247652479147</td>
<td class="red">-2.14%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="USDT" class="logo"></td>
<td>Tether USD</td>
<td>USDT</td>
<td>$1.0001714548786127</td>
<td class="green">-0.02%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="XRP" class="logo"></td>
<td>XRP</td>
<td>XRP</td>
<td>$2.30124856508901</td>
<td class="red">-5.34%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="BNB" class="logo"><
<td>BNB</td>
<td>BNB</td>
<td>$601.2000133364137</td>
<td class="red">-0.31%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="SOL" class="logo"></td>
<td>Solana</td>
<td>SOL</td>
<td>$128.941070936147</td>
<td class="red">-4.52%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="USDC" class="logo"></t
<td>USDC</td>
<td>USDC</td>
<td>$1.0000666752023008</td>
<td class="green">0.04%</td>
<td>-</td>
</tr>
<tr>
<td><img src="[Link] alt="ADA" class="logo"></td>
<td>Cardano</td>
<td>ADA</td>
<td>$0.7043767967789122</td>
<td class="red">-6.05%</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>

<script src="[Link]"></script>
</body>
</html>

CSS Code:
body {
font-family: Arial, sans-serif;
background: #f5f5f5;
padding: 20px;
}

.container {
width: 90%;
margin: auto;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

h2 {
margin-bottom: 10px;
color: #333;
}

#search {
width: 100%;
padding: 8px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 5px;
}

table {
width: 100%;
border-collapse: collapse;
}
table thead {
background: #333;
color: white;
}

table th, table td {


padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}

table tr:hover {
background: #f9f9f9;
}

.logo {
width: 25px;
height: 25px;
}

.red {
color: red;
}

.green {
color: green;
}

JavaScript Code:
function searchTable() {
let input = [Link]("search").[Link]();
let rows = [Link]("#cryptoTable tbody tr");

[Link](row => {
let text = [Link]();
[Link] = [Link](input) ? "" : "none";
});
}

You might also like