View Full Version : simple Organizational Chart

05-05-2009, 09:26 PM
I am trying to create an organizational chart in CSS without using tables. I dont think it should be that complex but I am not entirely sure how to do it.

There should be one big box on the top with three lines attaching from it to three smaller boxes below that one main box. (If the lines complicates things to much, i can do without them..) That is all. I have tried several things but they just dont come out right. Anyone know a code that I could use? Thanks in advance.

If all else fails, im thinking I will see if I can just create an image for this. however I would like to see how this is done in CSS/HTML

Old Pedant
05-05-2009, 11:59 PM
Ummm...are you aware you posted in the ASP forum?

This question doesn't seem to have anything to do with ASP, unless perhaps you also intend to try to draw the org chart dynamically based on info from a database???

I would think you should just post this in the HTML forum.

In general, you can't draw lines in HTML. But you can get sneaky: You can create rectangular <div>s and then just put borders on one or two edges of them.

Somewhat silly and inflexible example:

div { position: absolute; width: 200px; height: 50px; text-align: center; }
<div style="top: 40px; left: 250px; width: 500px; border: solid black 1px;">
<div style="top: 90px; left: 300px; border-left: solid black 1px; border-right: solid black 1px;">
<div style="top: 90px; left: 500px; border-right: solid black 1px;">
<div style="top: 140px; left: 150px; border: solid black 1px;">
<div style="top: 140px; left: 400px; border: solid black 1px;">
<div style="top: 140px; left: 650px; border: solid black 1px;">