Solved

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

Posted on 2011-09-10
9
367 Views
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
0
Comment
Question by:Kelvin4
  • 5
  • 2
  • 2
9 Comments
 
LVL 17

Expert Comment

by:OmniUnlimited
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.
0
 
LVL 40

Assisted Solution

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

Author Comment

by:Kelvin4
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..
Kelvin4
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36516028
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 17

Expert Comment

by:OmniUnlimited
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.
0
 

Assisted Solution

by:Kelvin4
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 -
K
0
 

Author Comment

by:Kelvin4
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">
<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
 

Author Closing Comment

by:Kelvin4
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
Regards,
Kelvin
0
 

Author Comment

by:Kelvin4
ID: 36550866
ok by Kelvin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now