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

Posted on 2011-09-10
Last Modified: 2012-05-12
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
Question by:Kelvin4
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
LVL 17

Expert Comment

ID: 36515981
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.
LVL 40

Assisted Solution

gurvinder372 earned 500 total points
ID: 36515982
rectangles and arrows can be achieved by giving borders to divs

Author Comment

ID: 36516017
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..
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 40

Accepted Solution

gurvinder372 earned 500 total points
ID: 36516028
it should be that complex

<div class=rectangle/>

   border: 1px solid #000;
   background-color: pink;

similarly for arrows
see this link

LVL 17

Expert Comment

ID: 36516054
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.

Assisted Solution

Kelvin4 earned 0 total points
ID: 36516185
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 -

Author Comment

ID: 36516315
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">
  <td>Item A</td>
  <th rowspan="2">Graphic here</th>
  <td>Item B</td>
  <td>Item C</td>

With many thanks

Author Closing Comment

ID: 36553411
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

Author Comment

ID: 36550866
ok by Kelvin

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question