NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
HTML Validator - Nested elements


Joined: 08 Dec 2008
Posts: 35
Reply with quote
Reference a sample table such as follows:

Code:

    <div id="home">
        <table class="noBorderRef" style="text-align: left;" id="data_selection" width="75%">
        <caption><h2>Sample Table</h2></caption>
            <tbody>
                <tr>
                    <th><img alt="" src="<?php echo $rand_img;?>"></th>
                    <th>
                        <ul> <h3>Six Principles of Sun Tzu & the Art of Business</h3>
                            <li>Capture your market without destroying it</li>
                            <li>Avoid your competitor’s strength, and attack their weakness</li>
                            <li>Use foreknowledge & deception to maximize the power of business intelligence</li>
                            <li>Use speed and preparation to swiftly overcome the competition</li>
                            <li>Use Alliances and Strategic Control Points to Your Advantage</li>
                            <li>Develop your character as a leader to maximize the potential of your employees</li>
                        </ul>
                    </th>
                </tr>
            </tbody>
        </table>
    </div>


Within PHPED, the <ul>,<li>,<h3>, </th>,</tr>,</table>,</div> tags are detected as improperly nested.Is this correct?

When viewed, everything lays out perfectly fine, but the warning bugs me to no end.

Is this correct, or am I doing something wrong (other than using tables)?

images:
Image of the editor showing warning text

image of code navigator showing improperly nested elements
View user's profileFind all posts by radi8Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
This is correct. UL can't have H3 nested directly. LI is the only element allowed as child elements of UL.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 08 Dec 2008
Posts: 35
Reply with quote
Dmitri, thanks so much for the reply, unfortunately, I erred in my previous post, sorry.

This condition happens even with just the <ul> and <li> elements as well. Inserting a <div> in the <th> element also causes the validation warning.

I found that if I change the column from a <th> to a <td>, the warning goes away.

So this appears to be an issue with the column header element (<th>).


I was playing with some formatting and had the <h3> in there and forgot to remove it before posting. Sorry about the confusion, I tried to be succinct.



Code:

        <table class="noBorderRef" style="text-align: left;" id="data_selection" width="75%">
            <caption><h2>Manage all aspects of Competitor Pricing here!</h2></caption>
            <tbody>
                <tr>
                    <th><img alt="Know thy Enemy!" src="<?php echo $rand_img;?>"></th>
                    <th>
                        <ul>
                            <li>Capture your market without destroying it</li>
                            <li>Avoid your competitor’s strength, and attack their weakness</li>
                            <li>Use foreknowledge & deception to maximize the power of business intelligence</li>
                            <li>Use speed and preparation to swiftly overcome the competition</li>
                            <li>Use Alliances and Strategic Control Points to Your Advantage</li>
                            <li>Develop your character as a leader to maximize the potential of your employees</li>
                        </ul>
                    </th>
                </tr>
            </tbody>
        </table>
View user's profileFind all posts by radi8Send private message


Joined: 22 Apr 2014
Posts: 22
Reply with quote
According to the specs you are right. A <ul> is valid inside a <th>, the unordered list falls under the Flow content and is allowed in the <th>. Instead of just writing it in the forums, you should submit it as a bug using the form on this page https://shop.nusphere.com/customer/support.php

W3C Ref: http://www.w3.org/TR/html5/tabular-data.html#the-th-element
View user's profileFind all posts by infcSend private message


Joined: 08 Dec 2008
Posts: 35
Reply with quote
Before I submitted it as a bug, I wanted to see if I was doing anything wrong and also if it could be replicated by others.

Thanks for the response.
View user's profileFind all posts by radi8Send private message


Joined: 22 Apr 2014
Posts: 22
Reply with quote
I can confirm that I have the same problem on version 13.041, 14.020 and 14.039. Inside the <th> it gives a warning, inside a <td> it validates correctly.

(I'm not sure why you would use <ul> in <th> since it's a table header, but the spec allows it and PHPEd should too)
View user's profileFind all posts by infcSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Hello all,

There was incorrect information in PHPEd's phped.rel configuration file.
You can fix it manually by modifying file %APPDATA%\NuSphere\PhpED\config\phped.rel

N.B. Each user on the computer has it's own copy of phped.rel, the copy of <PHPEd installation folder>\config\phped.rel

First, search line containing "[HTML.TagProps.HTML50]" (without quotes)
Below this line find the line starting with "th.Flags=", should be something like (spaces count may vary)
Code:
th.Flags=TAGTYPE_SPEC TAGCONTENT5_PHRASING TAGFLAG_OPTIONAL_END

And replace TAGCONTENT5_PHRASING with TAGTYPE5_FLOW.

Warning: Apply changes only to the line starting with "th.Flags=" otherwise you may got unexpected warnings like discussed above in thread.

Of course, bug in phped.rel will be fixed in further PHPEd releases.
View user's profileFind all posts by mdegtyarevSend private message
HTML Validator - Nested elements
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic