Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>&lt;tr&gt;&lt;/tr&gt;</code> marks a row. <code>&lt;td&gt;&lt;/td&gt;</code> marks a column. To make 2 columns, use just one set of <code>&lt;tr&gt;</code> tags per iteration, with two sets of <code>&lt;td&gt;&lt;/td&gt;</code>s between them.</p> <p>That said, what exactly is <code>$span</code>? Does it contain the same number of elements as <code>$anchors</code>, and you want to display one item from each per row? If so you'll need to restructure your code a bit. There are several ways to do this—here's a simple way:</p> <pre><code>&lt;table border="0" align="center"&gt; &lt;?php $i = 0; foreach($anchors as $a) { echo "&lt;tr&gt;"; $text = $a-&gt;nodeValue; $href = $a-&gt;getAttribute('href'); if ($i &gt;= 16) { if (strpos($text, "by owner") === false) { if (strpos($text, "map") === false) { echo "&lt;td&gt;&lt;a href =' ".$href." '&gt;".$text."&lt;/a&gt;&lt;br/&gt;&lt;/td&gt;"; } } } else { echo "&lt;td&gt;&lt;/td&gt;"; #output a blank cell in the first column } echo "&lt;td&gt;" . $span[$i]-&gt;nodeValue . "&lt;/td&gt;"; echo "&lt;/tr&gt;"; ++$i } ?&gt; &lt;/table&gt; </code></pre> <p>EDIT: It looks like your <code>$span</code> is a DOMNodeList object, not an array. I don't have experience with this, but it looks like you can use the <code>DOMNodelist::item</code> function to get the current item in the list (see <a href="http://php.net/manual/en/domnodelist.item.php" rel="nofollow">http://php.net/manual/en/domnodelist.item.php</a>):</p> <pre><code>echo "&lt;td&gt;" . $span-&gt;item($i)-&gt;nodeValue . "&lt;/td&gt;"; </code></pre> <p>So try changing the respective line in my answer to that.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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