• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

Placing HTML line and rectangle shapes to X1y1X2Y2 coordinates within one HTML table cell

I have an HTML table with cells containing various types of content. In ONE large cell, I need to place some line rectangles, and some arrowed lines, arranged as a flowchart. Lines
start at the edge of defined rectangles and terminate, with an arrow head, on the edge of other rectangles.  The xy coordinates of each rectangle and line are known, referenced to a corner of the cell. How do I write this HTML?

Thanks, Kelvin4
0
Kelvin4
Asked:
Kelvin4
  • 5
  • 2
  • 2
3 Solutions
 
OmniUnlimitedCommented:
My guess is that if you want to do this nicely, you will need to use images.  Is there a reason you couldn't make up the flowchart in some graphics program, say Photoshop or Illustrator, and simply place the image inside your large cell?

Or is this something that you are trying to change dynamically?

Either way, I'd say you would have to use images to acheive this effect.
0
 
Gurvinder Pal SinghCommented:
rectangles and arrows can be achieved by giving borders to divs
0
 
Kelvin4Author Commented:
Thanks, Omni..
I agree with your core response, however, as you suspected, I AM working with dynamic data-driven content, so images are not a solution in this case. A high level of artistic precision is not required.

The number and position of each element varies and can only be defined by coordinates.  HTML and other content data is packaged as ASCII code into json, and sent off to a functional web-based DB which unpacks the data and renders it as the HTML I now need to write, so it appears in the browser.

Thanks, Gurvinder:
I have been trying to find HTML examples of using div borders in cells in the way you indicate, but my searches were ineffective. Can you reference or send me an example, please?

With appreciation for your rapid responses..
Kelvin4
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Gurvinder Pal SinghCommented:
it should be that complex

<div class=rectangle/>

.rectangle
{
   width:100px;
   height:100px;
   border: 1px solid #000;
   background-color: pink;
}

similarly for arrows
see this link http://www.w3schools.com/css/css_border.asp

0
 
OmniUnlimitedCommented:
OK, so I take it from your response that the json packet contains x,y coordinates that have to be translated into your td?  How are you handling this?

Do rectangles have four sets of coordinates?  The lines two?  What sort of coding do you put for the direction the arrow is pointing?  Are rectangles and lines the only flow chart shapes you are using?

What sort of scripting language do you have available to generate your HTML?  PHP has some imaging capabilities using coordinates.
0
 
Kelvin4Author Commented:
Thanks, both.
Omni: we can interpret any HTML shape, including lines with right angle bends in them, polygons, etc. So its just the HTML syntax within a cell that I think I seek. The scripting language is flexible and simple.

Curvinder: Thanks for code and link. I will take a look through the site, run a test today and report back.

Ta for now -
K
0
 
Kelvin4Author Commented:
Hi Curvinder:
My HTML is weak:
Here is the HTML for a small table. I want to position a graphic in the cell labelled "Graphic here", at a specific px position from the top left corner of that cell, say 30px right and 20px down.

Could you enter your div-based syntax into the HTML below, so I can see how to use the HTML effectively?

<table border="1">
<tr>
  <th>Header</th>
  <td>Item A</td>
</tr>
<tr>
  <th rowspan="2">Graphic here</th>
  <td>Item B</td>
</tr>
<tr>
  <td>Item C</td>
</tr>
</table>

With many thanks
Kelvin
0
 
Kelvin4Author Commented:
Thanks Gurvinder,
I'm going to close the question here and submit a further question which is a bit more detailed and hopes you will fit your div solution (above) within the framework of my simple HTML tags (above). Can you help me further
Regards,
Kelvin
0
 
Kelvin4Author Commented:
ok by Kelvin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now