<div class="table-container">
<table class="responsive-table">
<thead>
<tr>
<th>Order ID</th>
<th>Customer</th>
<th>Status</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Order ID">#12345</td>
<td data-label="Customer">John Doe</td>
<td data-label="Status"><span class="status completed">Completed</span></td>
<td data-label="Amount">$120.00</td>
</tr>
<tr>
<td data-label="Order ID">#12346</td>
<td data-label="Customer">Jane Smith</td>
<td data-label="Status"><span class="status pending">Pending</span></td>
<td data-label="Amount">$85.50</td>
</tr>
</tbody>
</table>
</div>
.table-container {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.responsive-table {
width: 100%;
border-collapse: collapse;
}
.responsive-table th {
background: #f3f4f6;
padding: 12px;
text-align: left;
font-weight: 600;
color: #374151;
}
.responsive-table td {
padding: 12px;
border-bottom: 1px solid #e5e7eb;
color: #4b5563;
}
.status {
padding: 4px 8px;
border-radius: 4px;
font-size: 0.85rem;
font-weight: 500;
}
.status.completed {
background: #d1fae5;
color: #065f46;
}
.status.pending {
background: #fef3c7;
color: #92400e;
}
@media (max-width: 600px) {
.responsive-table thead {
display: none;
}
.responsive-table tr {
display: block;
margin-bottom: 15px;
border: 1px solid #e5e7eb;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.responsive-table td {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #f9fafb;
text-align: right;
}
.responsive-table td::before {
content: attr(data-label);
font-weight: 600;
color: #374151;
}
}