covid 19 realtime update table

How we can create a program for showing deadly coronavirus cases data? Solution: See this COVID 19 Realtime Update Table With Sort and Search, API Based Program.

Previously I have shared some API based programs, but this is about the most deadly disease in whole world right now name COVD 19 or coronavirus. There are many sources to getting the realtime cases data about this, but you can also create your own using a third-party API. Many types of API available in GitHub to create your own update program, some are comes with 3D globe but this is the basic one.

Today you will learn to create an API based data table program to show coronavirus cases count. Basically, there is a table with 4 columns for country names, total cases, deaths, and recovered. Also at the top, you will see the total count of cases, deaths, and recovered peoples over the world. And there is sort by program available, you can sort by most cases, most recovered, and most deaths also, you can search specific country.

So, Today I am sharing COVID 19 Realtime Update Table With Sort and Search features. There I have used HTML to create the structure or layout, CSS for styling, and JavaScript for getting and showing data over API. This program is fully dynamic and responsive in design. You can use this program to create your own live coronavirus update website or placing in your existing website.

If you are thinking now how this live update table actually is, then see the preview given below.

Preview Of API Based Coronavirus Live Cases Data

See this video preview to getting an idea of how this data table and its features look like.

Live Demo

Now you can see this program visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

COVID 19 Realtime Update Table Source Code

Before sharing source code, let’s talk about it. First I have created the structure using HTML divs, tables, input, and other elements. There I have created a text input for search, and select input for sort function. After that, I have created the table structure later it will fill by JS using API data. Also, create two more divs for scroll up and scroll down functions. In the HTML file, I have linked other files like CSS, JavaScript, and other CDN links.

Now using CSS I have placed all the items in the right place, as you can see in the preview. Using CSS first I gave basic values like size, position, margin, padding, etc to all the elements. There I have used flex display command to create the layout. For creating a responsive design, I have used the @media query and reduced some element’s size.

JavaScript handling there the fetch API data and showing function in this program. There JS commands are placed according to API documentation. After that, I have used JS if{} else{} statements to create the sort functions. Also used .addEventListener command to scroll up and down functions.

Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First for HTML, second for CSS, and third file for JavaScript. Follow the steps to creating this program without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created COVID 19 Realtime Update Table With Sort and Search, API Based Program. If you have any doubt or questions comment down below.

Thanks For Visiting, Keep Visiting.

3 COMMENTS

  1. Thank you for providing a very good COVID19 plugin. I have added this into my website along with Active and Today cases by adding sone code in function.js file by referencing it from the main API.

    As far India detailed report is concerned an API is available at https://api.covid19india.org. The home page is https://www.covid19india.org/
    Can you help-out the HTML and JS for the same API, where sorting is available by state-wise and further district-wise, just like in this plugin.

    Thank you
    Sunit

  2. Hello Shaan thank you for your awesome tutorials.

    php/mysqli
    Woud you be able to show countdown timer for multiple events on user input eg. input event (1); input time in minnutes (128) m; then SUBMIT Button. then these events shld show below in small box(table) with event 1, pic, Now; event 2, pic, 5m; event 3 pic, 10m; —> 10 displays dynamic . when event 1 (now) is completed the next upcoming event shows – always display a row of 10 events continuously.

    These events shld then show on another linked page in table format as : e1 ….etc.. full list of events colour coded – thank you :))

LEAVE A REPLY

Please enter your comment!
Please enter your name here