Course Wise Past Papers body{ font-family: Arial, sans-serif; background:#f2f4f7; margin:0; padding:15px; } .container{ max-width:1000px; margin:auto; } h2{ text-align:center; margin-bottom:20px; color:#333; } /* ===== TABLE (Desktop) ===== */ table{ width:100%; border-collapse:collapse; background:#fff; border-radius:10px; overflow:hidden; } th, td{ padding:16px; text-align:left; vertical-align:top; } th{ background:#1e88e5; color:#fff; } tr:nth-child(even){ background:#f9f9f9; } /* Papers list */ .paper{ display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid #eee; } .paper:last-child{ border-bottom:none; } .paper-name{ font-size:14px; color:#333; } .download-btn{ background:#d32f2f; color:#fff; padding:6px 12px; text-decoration:none; border-radius:6px; font-size:13px; white-space:nowrap; } .download-btn:hover{ background:#b71c1c; } /* ===== MOBILE CARD VIEW ===== */ @media(max-width:700px){ table, thead, tbody, th, tr{ display:block; } thead{ display:none; } table{ background:transparent; } tr{ background:#fff; margin-bottom:15px; border-radius:12px; box-shadow:0 6px 15px rgba(0,0,0,0.08); padding:15px; } td{ display:block; padding:0; } .course-title{ font-size:17px; font-weight:bold; margin-bottom:12px; color:#1e88e5; } .paper{ flex-direction:row; gap:10px; padding:10px 0; } .paper-name{ font-size:14px; } .download-btn{ padding:8px 14px; font-size:14px; } } Course Title Papers const courses = [ { title: "Functional English", papers: [ { name: "Mid Term 2022", link: "https://drive.google.com/file/d/MID2022/view" }, { name: "Final Term 2022", link: "https://drive.google.com/file/d/FINAL2022/view" }, { name: "Mid Term 2023", link: "https://drive.google.com/file/d/MID2023/view" } ] }, { title: "Islamic Studies", papers: [ { name: "Islamic studies by mahmood ashraf", link: "https://drive.google.com/file/d/1CeyU38POO-IegaKtt2Fj3HWYXhO1e3EU/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "18th Century English Novel", papers: [ { name: "18th century novel by Mam sana ghaffar", link: "https://drive.google.com/file/d/18ZZO-Mdr5wlEJu1sc9P6zzj_5mKj1Mp_/view?usp=drivesdk" }, { name: "18th century novel by sir Tariq Masood", link: "https://drive.google.com/file/d/1VCBRyszOyAqgBKdGt_i2X_19JCsTYmXh/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "History of English Literature", papers: [ { name: "History of English by Mam mariam batool", link: "https://drive.google.com/file/d/1KWX5N6Aatj8e3kVvODVXwq4Vq6xX4ZOl/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "ICT", papers: [ { name: "ICT by Ma'am Okasha Sarwar", link: "https://drive.google.com/file/d/122OlIn3UnUK4XsbImcP8CBca84OY4b30/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "Introduction to Literary Devices and Genres", papers: [ { name: "Literary devices by Sir imran adeel", link: "https://drive.google.com/file/d/1NBNpxqqySA5TfWNvvMnoh9Ds8V7QTDjh/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "Translation of the Holy Quran-I", papers: [ { name: "Mid Term 2023", link: "https://drive.google.com/file/d/IS_MID_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] } ]; const tableBody = document.getElementById("courseTableBody"); courses.forEach(course => { let papersHTML = ""; course.papers.forEach(paper => { papersHTML += ` ${paper.name} 📄Download PDF `; }); tableBody.innerHTML += ` ${course.title} ${papersHTML} `; });