Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Array
  • JS String
  • JS Object
  • JS Operator
  • JS Date
  • JS Error
  • JS Projects
  • JS Set
  • JS Map
  • JS RegExp
  • JS Math
  • JS Number
  • JS Boolean
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
Open In App
Next Article:
How to create a dynamic report card using HTML, CSS and JavaScript ?
Next article icon

How to create a dynamic report card using HTML, CSS and JavaScript ?

Last Updated : 30 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

We have to build a website where you can upload your student data like their name and marks in different subjects. And after uploading it will insert the student data in the table as well as, it will show the total marks, average, and pass/fail status. The implementation is done by using HTML and JavaScript.

Approach:

  • At first, we have to create some rows and columns for name and subject scores. Again subject scores will be further divided into four columns. There are four subject names that will be displayed. Users are allowed to enter the details with a click button to "Add To Table".
  • There will be another table Student Data with four columns Name, Total, Average, Pass Or Fail.
  • For every entered data, one row will add to the score table, showing the student's total score, average and pass or fail status. If the average score is greater than 70 then the status is "pass" otherwise the status is "fail".
  • If we enter other data it will store in the table.

Example: This example describes the above-explained approach.

HTML
<!DOCTYPE html> <html>  <body bgcolor="lightblue">     <center>     <table border="1" cellspacing="5" bgcolor="white">         <caption><b>Input Marks</b></caption>         <tr>             <th rowspan="2">Name</th>             <th colspan="4">Score</th>          </tr>         <tr>             <th>Hindi</th>             <th>English</th>             <th>Math</th>             <th>C Programming</th>         </tr>         <tr>             <td><input type="text" id="aname"></td>             <td><input type="text" id="am"></td>             <td><input type="text" id="aj"></td>             <td><input type="text" id="ad"></td>             <td><input type="text" id="an"></td>         </tr>         <tr>             <th colspan="5" height="30">             <input type="submit" value="Add To Table" onclick="Sub()"></th>         </tr>         </table>     <br>     <table border="1" cellspacing="5" bgcolor="white"             height="100" width="500" cellpadding="5" id="TableScore">         <caption><b>Student Data</b></caption>         <tr>             <th width="180">Name</th>             <th>Total</th>             <th>Average</th>             <th>Pass Or Fail</th>         </tr>              </table>     </center>     <script type="text/javascript">         function Sub(){             let n, k, r, e, v, sum, avg;             n=(document.getElementById('aname').value);             k=parseFloat(document.getElementById('am').value);             r=parseFloat(document.getElementById('aj').value);             e=parseFloat(document.getElementById('ad').value);             v=parseFloat(document.getElementById('an').value);             // Calculating Total             sum=k+r+e+v;             avg=sum/4;             // Display on Student Data             let newTable = document.getElementById('TableScore');             let row = newTable.insertRow(-1);             let cell1 = row.insertCell(0);             let cell2 = row.insertCell(0);             let cell3 = row.insertCell(0);             let cell4 = row.insertCell(0);              cell4.innerHTML= n;             cell3.innerHTML=sum;             cell2.innerHTML = avg;              if(avg>=70){                 cell1.innerHTML="<font color=green>Pass</font>";             }else{                 cell1.innerHTML="<font color=red>Fail</font>";             }         }     </script> </body> </html> 

Output:


Next Article
How to create a dynamic report card using HTML, CSS and JavaScript ?

S

sounetraghosal2000
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • JavaScript-Projects

Similar Reads

    How to create A Dynamic Calendar in HTML CSS & JavaScript?
    In this article, we will see how we can create A Dynamic Calendar with the help of HTML, CSS & JavaScript. We will be designing and implementing a straightforward yet effective dynamic calendar, offering seamless month navigation and quick access to the current month. With a visually appealing d
    10 min read
    How to create a Color Generator using HTML CSS and JavaScript ?
    In this article, we will develop a Color Generator application using HTML, CSS, and JavaScript.In this application, we have created the Multi Format color generator. Users can select Colour Types like RGB, HEX, and CMYK. Use the sliders to customize the color and Inout field in case of HEX and color
    6 min read
    Dynamic Resume Creator using HTML CSS and JavaScript
    Creating a well-structured and professional resume can be time-consuming and difficult for many job seekers. Challenges like formatting, organizing details, and making the resume stand out are common. To solve this issue, a Resume Creator project was developed to simplify the process by offering an
    5 min read
    How to Create a Portfolio Website using HTML CSS and JavaScript ?
    A portfolio website is a website that represents you online on the web pages. It contains different sections like Introduction to Yourself, About You, Your Services, Your Contact Details, and Your Portfolio. We are going to build all of the sections with an interactive and attractive web design that
    15+ min read
    Create a Responsive Admin Dashboard using HTML CSS and JavaScript
    An Admin Panel typically has several sections that enable the administrator to manage and control various activities on a website. The layout usually consists of a header and a sidebarnavigation bar, which allows the admin to easily navigate between the various sections of the panel. In the header,
    9 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences