Draw a Simple Bar Chart in HTML

Draw a Simple Bar Chart in HTML

There are a lot of graphics packages for Web pages on the market, but sometimes you still want a homegrown solution. Using just HTML, it is possible to create simple bar charts. The trick is to embed tables inside a table and change the width property of the

tag of the inner table. To create a simple positive only bar chart, use this template. Just repeat the code between the

tag for each item you want to display. Note that there is a blank space in the

field. Without this blank space, the bar would not be displayed in Netscape.

 
Item 1
37%

This code produces this bar chart:

Item 1
37%

It is a little trickier if you want to display positive and negative data. Instead of having one nested table, you have two tables, each nested in its own

tag. Also, you have to change the alignment so that negatives are right-aligned while positives are left-aligned. You can play with the widths of the

tags of the outside table for different effects.

 
Item 1
15%
Item 2
-3%

This code produces this bar chart:

Item 1
15%
Item 2
-3%
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular