.responsive-table { overflow-x: auto; } .responsive-table table { width: 100%; border-collapse: collapse; } .responsive-table th, .responsive-table td { border: 1px solid #ddd; padding: 8px; text-align: left; } .responsive-table th { background-color: #f4f4f4; } @media (max-width: 600px) { .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table th, .responsive-table td, .responsive-table tr { display: block; } .responsive-table tr { margin-bottom: 10px; } .responsive-table td { text-align: right; position: relative; padding-left: 50%; } .responsive-table td::before { content: attr(data-label); position: absolute; left: 0; width: 50%; padding-left: 10px; font-weight: bold; text-align: left; } }