Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

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

  • Last Updated : 03 Aug, 2021

We have to build a website where you can upload your student data like their name, 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.


Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!

  • 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 another data it will store in the table.



<!DOCTYPE html>
<body bgcolor="lightblue">
    <table border="1" cellspacing="5" bgcolor="white">
        <caption><b>Input Marks</b></caption>
            <th rowspan="2">Name</th>
            <th colspan="4">Score</th>
            <th>C Programming</th>
            <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>
            <th colspan="5" height="30">
            <input type="submit" value="Add To Table" onclick="Sub()"></th>
    <table border="1" cellspacing="5" bgcolor="white" 
           height="100" width="500" cellpadding="5" id="TableScore">
        <caption><b>Student Data</b></caption>
            <th width="180">Name</th>
            <th>Pass Or Fail</th>
    <script type="text/javascript">
        function Sub(){
            var n, k, r, e, v, sum, avg;
            // Calculating Total
            // Display on Student Data
            var newTable = document.getElementById('TableScore');
            var row = newTable.insertRow(-1);
            var cell1 = row.insertCell(0);
            var cell2 = row.insertCell(0);
            var cell3 = row.insertCell(0);
            var cell4 = row.insertCell(0);
            cell4.innerHTML= n;
            cell2.innerHTML = avg;
                cell1.innerHTML="<font color=green>Pass</font>";
                cell1.innerHTML="<font color=red>Fail</font>";


Pass or Fail status of Students

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!