I am a newbie in HTML/CSS and am building a web application using Django right now.
This application draws it's data from a precalculated database. Each entry has a certain length and contains several child entries, which length of each is a fraction of the whole length of the parent entry. As python dictionary it looks like this:
{entry1: {'length': 10000, {child1}: {'start':1, 'end':1000 }, {child2}: {'start':2000, 'end':6000}, ...}
The length of each child is end-start here.
What I am trying to do is to display each entry as a line in HTML/CSS, and each child entry is shown as button on that line. The size of each button on the line should reflect it's length (which is a fraction of the parent entry length, but it's different for each child entry). Importantly, each child entry has a certain position on the parent entry (For example: The parent entry length is 10000, child 1 is at 1-1000, child 2 is at 2000 to 6000 and so on)
The result I want to get to is something like this:

I have several tens of entries that I want to display like this, eventually even making graphic connections from one entry to the one displayed below. (Let's say draw a line from entry 1, position 1200 to entry 2, position 400).
I have managed to place the buttons on a line in HTML/CSS, but I have no idea on how to go about adjusting each buttons with appropriately or how to put them in the right position on the parent line.
Could anyone point me towards code, libraries, methods, tutorials or other stuff that could help me achieve this?