473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Building a tree from a HTML report with DOM?

I have a 3rd party product that output reports to html.

It's quite old now and doesn't output some reports correctly.

We have a report that should show a structure like this:

Europe
France
Paris
UK
London
Germany
Munich
Spain
Madrid
Americas
USA
New York
Canada
Toronto
APAC
Australia
Canberra
NZ
Auckland

The trouble is that it doesn't!

The html output is like so (I've snipped it to save on space).

<table>
<tr>
<td>Europe</td>
</tr>
<tr>
<td> France</td>
</tr>
<tr>
<td> Paris</td>
</tr>
<tr>
<td> UK</td>
</tr>
<tr>
<td> London</td>
</tr>
etc etc etc

I take it because the "spaces" aren't &nbsp; it doesn't show
correctly.

Ideally I'd like to do something clever and make it a expandable tree
so users can expand the company structure as they wish.

Is this a possibility with DOM?

Thanks in advance!
Jul 23 '05 #1
3 1303
On 14 Dec 2004 07:14:10 -0800, Craig <cm*******@yahoo.co.uk> wrote:

[snip]
I take it because the "spaces" aren't &nbsp; it doesn't show correctly.
Yes, but the output should be changed entirely. The data is obviously a
set of nested lists.

[snip]
Is this a possibility with DOM?


I don't believe so. The spaces will be collapsed and as this is the only
form of structure to the data (unless you're abridging the mark-up), there
will be no way to determine which "level" the table data actually belongs
to. You'll have to preprocess the output directly or change to a competent
program.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
Craig wrote on 14 dec 2004 in comp.lang.javascript:
Europe
France
Paris
UK
London


Use css classes:

<style>
..continent {padding-left:0;}
..country {padding-left:20px;}
..capital {padding-left:40px;}
</style>

<table>
<tr><td class=continent>Europe</td></tr>
<tr><td class=country>France</td></tr>
<tr><td class=capital>Paris</td></tr>
<tr><td class=country>Britain</td></tr>
<tr><td class=capital>London</td></tr>
....

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #3

Evertjan. wrote:
Craig wrote on 14 dec 2004 in comp.lang.javascript:
Europe
France
Paris
UK
London


Use css classes:

<style>
.continent {padding-left:0;}
.country {padding-left:20px;}
.capital {padding-left:40px;}
</style>

<table>
<tr><td class=continent>Europe</td></tr>
<tr><td class=country>France</td></tr>
<tr><td class=capital>Paris</td></tr>
<tr><td class=country>Britain</td></tr>
<tr><td class=capital>London</td></tr>
...

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Max | last post by:
We want to implement assigning permissions to web pages using a tree like view. The text below illustrates what the page would look like. Each of the items in the boxes are types of permissions...
4
by: Jerry Khoo | last post by:
Thanks for the answer, and by the way, i would like to know that in C++, how u create a tree using a recursive envronment. It seems that most people used struct to create a node than, using...
7
by: johkar | last post by:
I am confused on childNodes or children. When you have nested lists, I would think it would all be one list in the Dom, this doesn't seem to be the case. So how do you traverse an unordered list?...
7
by: Hal Vaughan | last post by:
I have a problem with port forwarding and I have been working on it for over 2 weeks with no luck. I have found C programs that almost work and Java programs that almost work, but nothing that...
2
by: UJ | last post by:
I have an app that I've already written that works just great. It's a window's explorer like app for our data. Problem is, to build the treeview takes too long (30 secs and upward for less than...
1
by: dArt | last post by:
I am not sure if acces is suitable for the task i want to use it. So i am asking is it posible to draw tree in report. To make evrything more simple i will tell task i need to do. I need some...
3
by: wsox66 | last post by:
I am new to Access and need some help building a report. I have looked through previous posts on reports but none of them seem to answer my question completely. I am using Access 2003 and I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.