Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd suggest simplifying your table a little bit, maybe taking the 'Displaying $numrows results' out of the table entirely.</p> <p>The line '&lt;tr&gt; Displaying $numrows results&lt;/tr&gt;' is not valid HTML. &lt;tr&gt; means 'Define a new table row', but it needs a &lt;td&gt; inside it to wrap the content. Because most rows of your table contain several TD elements, whilst this row only contains one piece of information, you would need to tell that table cell to <a href="http://www.ironspider.ca/tables/tablecells2.htm" rel="nofollow">span multiple columns</a>. </p> <p>A good way of debugging this sort of thing is to feed the generated HTML to <a href="http://validator.w3.org/" rel="nofollow">http://validator.w3.org/</a>, or replace the $variables with sample data and feed the template code to a validator. This is usually a little frustrating at first (as it will force you to be exact about the HTML version you want to use, etc) but it is a good way of tracing problems. If you feed the following HTML snippet into the W3 validator, it will give you some useful feedback:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt; &lt;head&gt;&lt;title&gt;A&lt;/title&gt;&lt;/head&gt; &lt;body&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt;aaa&lt;/td&gt;&lt;td&gt;bbb&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;cccc&lt;/td&gt;&lt;td&gt;dddd&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;Test&lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The validator tells you that: Line 7, Column 5: character data is not allowed here</p> <pre><code>&lt;tr&gt;Test&lt;/tr&gt; </code></pre> <p>In other words, the TR element should not directly contain text.</p> <p>It also says that: Line 7, Column 13: end tag for "tr" which is not finished</p> <pre><code>&lt;tr&gt;Test&lt;/tr&gt; </code></pre> <p>"Most likely, you nested tags and closed them in the wrong order... Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the &lt;head&gt; element must contain a &lt;title&gt; child element, lists require appropriate list items (&lt;ul&gt; and &lt;ol&gt; require &lt;li&gt; ...), and so on."</p> <p>Once you have the static HTML looking, and validating, the way you want, you can then add the PHP loops back in, but this time you can compare the script output to your working HTML example. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload