title: Validation notice: "Start tag DIV seen in table"
body: <p>I'm getting this error running validation: "Start tag div seen in table"  that results in "Cannot recover after last error. Any further errors will be ignored".</p>
  
  <pre><code>&lt;div class="post"&gt;
      &lt;table&gt;
  
          &lt;?php
          $dir   = 'img/';
          $filetype = '*.*';
          $allow = array('jpg');
          $files = glob($dir.$filetype);
          $newest_images_first = true;
          $files = array_reverse($files);
          $i=0;
          $open = opendir($dir);      
          while (($file=readdir($open))!==false) {$ext=str_replace('.', '', strrchr($file, '.'));if (in_array($ext, $allow)) $list[$i++]=$file; }
          $perPage= 20;
          $total=count($list);
          $pages=ceil($total/$perPage);
          $thisPage=isset($_GET['pg'])?$_GET['pg']-1:0;
          $start=$thisPage*$perPage;
          $pageNumber= $thisPage+1;
          $perRow= 1;
          $imgCnt=0;
          $imgCnt+=1;
          for ($i=$start;$i&lt;$start+$perPage;$i++) 
  
          { // &lt;---------- this opens element
  
              echo '&lt;div class="item"&gt;';  // &lt;----------- this div doesn't open!!
  
                  // Preloader
                  echo '&lt;div class="preloader"&gt;&lt;/div&gt;';
  
                  if (isset($list[$i])) {
  
                    echo '&lt;figure&gt;';
                     echo '&lt;div class="photo"&gt;';
  
                      $exif = exif_read_data($files[$i], 0, true);
                      error_reporting(E_ERROR | E_PARSE);
                      $title = substr($files[$i],strlen($dir),strrpos($files[$i], '.')-strlen($dir));
                      $title = str_replace( array( '%', '_'), " ", $title);
                      $title = substr($title, 5);
                      $title = str_replace( array('', '_'), "", $title);
                      $imgname = $files[$i]; 
                      echo '&lt;img src="'.$imgname.'" alt="blahblah '.$title.'" onLoad="this.width*=0.6;imgLoaded(this);" onError="this.onerror=null;this.src="bundles/blank.svg";"&gt;';
  
                    echo '&lt;/div&gt;'; // .photo
  
                    echo '&lt;figcaption&gt;';                  
  
                    $title = preg_replace('/\'([^\']+)\'/', '&lt;em&gt;$1&lt;/em&gt;', $title);
                    echo '&lt;h2&gt;'."". $title .'&lt;/h2&gt;';
                    echo "&lt;p&gt;".$exif['IFD0']['ImageDescription']."&lt;/p&gt;";
  
                    echo '&lt;/figcaption&gt;';     
                   echo '&lt;/figure&gt;';          
  
                              }
  
                              else {
                              echo "&lt;td&gt;&lt;/td&gt;";
                              }
  
                      if ($imgCnt%$perRow==0) echo "&lt;/tr&gt;&lt;tr&gt;";
  
                      echo '&lt;/div&gt;'; // .item
  
                      }
  
                      closedir($open);
                      ?&gt;
  
                      &lt;/table&gt;        
  
                  &lt;/div&gt; &lt;!-- post --&gt;
  </code></pre>
  
  <p>I have tried many things, yet I could not find the solution. Any ideas what's going on?</p>