HTMLTreeView

3 отговора 186 прегледа
#1

HTMLTreeView

Имам следния HTML за дърво и папки. Всичо е добре, но разтоянието от иконката до текста е много голямо. Има ли начин това да се промени с използването на стил или по друг начин? Разбира се, че може да се направи в таблица и там да се направят различни отмествания, но HTML- ла става по сложен и голям. Имам желание да го направя по възможно най- простия начин.
Благодяря предварително за помоща.



<HTML>
<HEAD></HEAD>
<BODY>
<DL>
<a name="Fold1" href="..."><DT><img src="folderopen.gif" align=left border="0"><DD>Folder 1</a>
<DL>
<a name="Fold101" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 101</a>
<a name="Fold102" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 102</a>
<a name="Fold103" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 103</a>
<a name="Fold104" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 104</a>
<a name="Fold105" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 105</a>
<a name="Fold106" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 106</a>
<a name="Fold107" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 107</a>
</DL>
<a name="Fold12" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 2</a><BR>
<a name="Fold13" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 3</a><BR>
<a name="Fold14" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 4</a><BR>
<a name="Fold15" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 5</a><BR>
<a name="Fold16" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 6</a><BR>
<a name="Fold17" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 7</a><BR>
<a name="Fold18" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 8</a><BR>
<a name="Fold19" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 9</a><BR>
<a name="Fold10" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 10</a><BR>
<a name="Fold11" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 11</a><BR>
<a name="Fold12" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 12</a><BR>
<a name="Fold13" href="..."><DT><img src="folderclosed.gif" align=left border="0"><DD>Folder 13</a>
</UL> <BR>
</BODY>
</HTML>



Отговор
в отговор на Pita6t #2

Re: HTMLTreeView

Забравихда спомена, че иконките (folderclosed.gif и folderopen.gif) са с размери 16х16 точки

Отговор
в отговор на Pita6t #3

Re: HTMLTreeView

Много ми се иска да попитам... кой го измисли тоя html? Ако си ти, наистина най-добре да преосмислиш работата си като хтмл писач...

Отговор
в отговор на Pita6t #4

Re: HTMLTreeView

Учудващо наистина как може в 29 реда код да има 75 грешки!!!

======================================================
Валидатора каза че тоя код не го кефи:
======================================================

File: sumtin.htm
Encoding: utf-8
Doctype: HTML 4.01 Transitional
Errors: 75
No Character Encoding Found! Falling back to UTF-8.

I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

No DOCTYPE Found! Falling Back to HTML 4.01 Transitional

A DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate this document. I am falling back to "HTML 4.01 Transitional" and will attempt to validate the document anyway, but this is very likely to produce spurious error messages for most non-trivial documents.

DOCTYPE Fallback in effect!
The DOCTYPE Declaration in your document was not recognized. This probably means that the Formal Public Identifier contains a spelling error, or that the Declaration is not using correct syntax. Validation has been performed using a default "fallback" Document Type Definition that closely resembles HTML 4.01 Transitional, but the document will not be Valid until you have corrected the problem with the DOCTYPE Declaration.
This page is not Valid HTML 4.01 Transitional!

Below are the results of attempting to parse this document with an SGML parser.

1.

Line 1, column 0: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"

<HTML>

The checked page did not contain a document type ("DOCTYPE") declaration. The Validator has tried to validate with the HTML 4.01 Transitional DTD, but this is quite likely to be incorrect and will generate a large number of incorrect error messages. It is highly recommended that you insert the proper DOCTYPE declaration in your document -- instructions for doing this are given above -- and it is necessary to have this declaration before the page can be declared to be valid.

&#9993;
2.

Line 2, column 14: end tag for "HEAD" which is not finished

<HEAD></HEAD>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element (e.g. 'ul') which requires a child element (e.g. 'li') that you did not include. Hence the parent element is "not finished", not complete.

&#9993;
3.

Line 5, column 32: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold1" href="..."><DT><img src="folderopen.gif" align=left border

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

&#9993;
4.

Line 5, column 36: document type does not allow element "DT" here

<a name="Fold1" href="..."><DT><img src="folderopen.gif" align=left border

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

&#9993;
5.

Line 5, column 84: required attribute "ALT" not specified

...folderopen.gif" align=left border="0"><DD>Folder 1</a>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

&#9993;
6.

Line 5, column 88: document type does not allow element "DD" here

...eropen.gif" align=left border="0"><DD>Folder 1</a>

&#9993;
7.

Line 6, column 9: document type does not allow element "DL" here; assuming missing "DD" start-tag

<DL>

&#9993;
8.

Line 7, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold101" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
9.

Line 7, column 40: document type does not allow element "DT" here

<a name="Fold101" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
10.

Line 7, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 101</a>

&#9993;
11.

Line 7, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 101</a>

&#9993;
12.

Line 8, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold102" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
13.

Line 8, column 40: document type does not allow element "DT" here

<a name="Fold102" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
14.

Line 8, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 102</a>

&#9993;
15.

Line 8, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 102</a>

&#9993;
16.

Line 9, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold103" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
17.

Line 9, column 40: document type does not allow element "DT" here

<a name="Fold103" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
18.

Line 9, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 103</a>

&#9993;
19.

Line 9, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 103</a>

&#9993;
20.

Line 10, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold104" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
21.

Line 10, column 40: document type does not allow element "DT" here

<a name="Fold104" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
22.

Line 10, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 104</a>

&#9993;
23.

Line 10, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 104</a>

&#9993;
24.

Line 11, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold105" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
25.

Line 11, column 40: document type does not allow element "DT" here

<a name="Fold105" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
26.

Line 11, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 105</a>

&#9993;
27.

Line 11, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 105</a>

&#9993;
28.

Line 12, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold106" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
29.

Line 12, column 40: document type does not allow element "DT" here

<a name="Fold106" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
30.

Line 12, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 106</a>

&#9993;
31.

Line 12, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 106</a>

&#9993;
32.

Line 13, column 36: document type does not allow element "A" here; missing one of "DT", "DD" start-tag

<a name="Fold107" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
33.

Line 13, column 40: document type does not allow element "DT" here

<a name="Fold107" href="..."><DT><img src="folderclosed.gif" align=left

&#9993;
34.

Line 13, column 90: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 107</a>

&#9993;
35.

Line 13, column 94: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 107</a>

&#9993;
36.

Line 14, column 10: end tag for "DL" which is not finished

</DL>

&#9993;
37.

Line 15, column 34: document type does not allow element "DT" here

<a name="Fold12" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
38.

Line 15, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 2</a><BR>

&#9993;
39.

Line 15, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 2</a><BR>

&#9993;
40.

Line 16, column 34: document type does not allow element "DT" here

<a name="Fold13" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
41.

Line 16, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 3</a><BR>

&#9993;
42.

Line 16, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 3</a><BR>

&#9993;
43.

Line 17, column 34: document type does not allow element "DT" here

<a name="Fold14" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
44.

Line 17, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 4</a><BR>

&#9993;
45.

Line 17, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 4</a><BR>

&#9993;
46.

Line 18, column 34: document type does not allow element "DT" here

<a name="Fold15" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
47.

Line 18, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 5</a><BR>

&#9993;
48.

Line 18, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 5</a><BR>

&#9993;
49.

Line 19, column 34: document type does not allow element "DT" here

<a name="Fold16" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
50.

Line 19, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 6</a><BR>

&#9993;
51.

Line 19, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 6</a><BR>

&#9993;
52.

Line 20, column 34: document type does not allow element "DT" here

<a name="Fold17" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
53.

Line 20, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 7</a><BR>

&#9993;
54.

Line 20, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 7</a><BR>

&#9993;
55.

Line 21, column 34: document type does not allow element "DT" here

<a name="Fold18" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
56.

Line 21, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 8</a><BR>

&#9993;
57.

Line 21, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 8</a><BR>

&#9993;
58.

Line 22, column 34: document type does not allow element "DT" here

<a name="Fold19" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
59.

Line 22, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 9</a><BR>

&#9993;
60.

Line 22, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 9</a><BR>

&#9993;
61.

Line 23, column 34: document type does not allow element "DT" here

<a name="Fold10" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
62.

Line 23, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 10</a><BR>

&#9993;
63.

Line 23, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 10</a><BR>

&#9993;
64.

Line 24, column 34: document type does not allow element "DT" here

<a name="Fold11" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
65.

Line 24, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 11</a><BR>

&#9993;
66.

Line 24, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 11</a><BR>

&#9993;
67.

Line 25, column 34: document type does not allow element "DT" here

<a name="Fold12" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
68.

Line 25, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 12</a><BR>

&#9993;
69.

Line 25, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 12</a><BR>

&#9993;
70.

Line 26, column 34: document type does not allow element "DT" here

<a name="Fold13" href="..."><DT><img src="folderclosed.gif" align=left border

&#9993;
71.

Line 26, column 84: required attribute "ALT" not specified

...lderclosed.gif" align=left border="0"><DD>Folder 13</a>

&#9993;
72.

Line 26, column 88: document type does not allow element "DD" here

...closed.gif" align=left border="0"><DD>Folder 13</a>

&#9993;
73.

Line 27, column 5: end tag for element "UL" which is not open

</UL> <BR>

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry.

&#9993;
74.

Line 28, column 8: end tag for "DL" omitted, but its declaration does not permit this

</BODY>

&#9993;
75.

Line 4, column 4: start tag was here

<DL>

So long and thanks for all the fish!
Отговор