body { font-family: Arial, sans-serif; padding: 15px; background-color: #f0f2f5; color: #333; margin: 0; } h1 { text-align: center; margin-bottom: 20px; color: #2c3e50; font-size: 1.8em; } /* Table styles */ table { border-collapse: collapse; width: 100%; max-width: 1000px; margin: 0 auto; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } th, td { border: 1px solid #ccc; text-align: center; padding: 10px; vertical-align: top; } th { background-color: #e0e0e0; font-weight: bold; } td { transition: background-color 0.2s; } td:hover { background-color: #f7f7f7; } .subject { font-weight: bold; color: #1f618d; } .teacher { font-size: 0.9em; color: #2c3e50; } .room { font-size: 0.8em; color: #666; } /* @media (max-width: 768px) { table, thead, tbody, th, td, tr { display: block; width: 100%; } tr { margin-bottom: 15px; border-bottom: 2px solid #ddd; padding-bottom: 10px; } th { display: none; } td { text-align: left; padding: 10px 10px 10px 45%; position: relative; border: none; border-bottom: 1px solid #eee; } td::before { position: absolute; left: 10px; top: 10px; width: 40%; white-space: nowrap; font-weight: bold; content: attr(data-label); } td:last-child { border-bottom: 0; } } @media (max-width: 480px) { body { padding: 10px; } h1 { font-size: 1.5em; } td::before { font-size: 0.9em; } td { padding-left: 50%; } } */ @media (max-width: 768px) { table, thead, tbody, th, td, tr { display: block; width: 100%; } tr { margin-bottom: 15px; padding: 0; border-bottom: 2px solid #ddd; } th { display: none; } td { position: relative; padding-left: 50%; text-align: left; border: none; border-bottom: 1px solid #eee; min-height: 50px; /* ensures consistent vertical spacing */ box-sizing: border-box; } td::before { position: absolute; top: 10px; left: 10px; width: 40%; font-weight: bold; white-space: nowrap; content: attr(data-label); } /* make content stack nicely */ td > .subject, td > .teacher, td > .room { display: block; margin: 2px 0; } td:last-child { border-bottom: 0; } } /* Extra small screens */ @media (max-width: 480px) { td { padding-left: 55%; } td::before { width: 45%; } }