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: "Introduction to Psychology", 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: "Modern Critical Theories and Practices", papers: [ { name: "Criticism 2 by Ma'am Fatima Maryam", link: "https://drive.google.com/file/d/18HOp02Dc_GRYfG60OBFlPFhTqbI999is/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: "American Literature", papers: [ { name: "American Novel by Ma'am Zarina qasim", link: "https://drive.google.com/file/d/1xg5V8F4T41VQidUbkRMPFEumZVUwM5L5/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: "20th Century Prose", papers: [ { name: "Prose 2 by sir Naveed", link: "https://drive.google.com/file/d/1ScUDBEQYxd4hBg7-rYMD1SG1nIQm04GF/view?usp=drivesdk" }, { name: "prose 3 by sir Naveed", link: "https://drive.google.com/file/d/1LzQy7OwG8DzTSCyELzg_yih-jo8q6RgZ/view?usp=drivesdk" }, { name: "Final Term 2023", link: "https://drive.google.com/file/d/IS_FINAL_2023/view" } ] }, { title: "Research Methodology", 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" } ] }, { title: "Narratology", 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} `; });