<?php

$domd0 = new DOMDocument();
     $domd0->encoding = 'utf-8';
     $domd0->xmlVersion = '1.0';
     $domd0->formatOutput = true;
     $elem0=$domd0;

     $div0=$elem0->appendChild($domd0->createElement('div'," "));
     $div0->setAttribute("style","float:left;margin-left:0.5em;margin-right:0.5em;margin-bottom:0em;");

     $table=$div0->appendChild($domd0->createElement('table',""));
     $table->setAttribute("style","background:url('https://vcrxol.com/_otro/estadio.png') no-repeat center center;background-size: cover;");
     $table->setAttribute("border","1");
     $table->setAttribute("cellpadding","0");
     $tr=$table->appendChild($domd0->createElement('tr',""));
     $td=$tr->appendChild($domd0->createElement('th',$znombre));
     $td->setAttribute("colspan","8");
     $td->setAttribute("bgcolor","yellow");

     for ($fil=1; $fil<=9; $fil++)
         {
              $tr=$table->appendChild($domd0->createElement('tr',""));
              for ($col=1; $col<=8 ; $col++)
                  {
                      $color = '';
                      if ($col==4 and $fil==2) $color = "red";
                      if ($col==1 and $fil==5) $color = "red";
                      if ($col==8 and $fil==5) $color = "red";
                      $td=$tr->appendChild($domd0->createElement('td',""));
                      $td->setAttribute("style","width:22px; height:22px;background-color:".$color.';');
                  }
         }


//$td->setAttribute("style","border:1px;border-style:solid;border-color:black;");
     
// $td->setAttribute("style","background-color:".$empr0['empr_color2 '].";");


//     $tr11=$table->appendChild($domd0->createElement('tr',""));
//     $tr12=$table->appendChild($domd0->createElement('tr',""));

//     $td=$tr12->appendChild($domd0->createElement('td',"celda xx"));
//     $td=$tr11->appendChild($domd0->createElement('td',"c<?php

$domd0 = new DOMDocument();
     $domd0->encoding = 'utf-8';
     $domd0->xmlVersion = '1.0';
     $domd0->formatOutput = true;
     $elem0=$domd0;

     $div0=$elem0->appendChild($domd0->createElement('div'," "));
     $div0->setAttribute("style","float:left;margin-left:0.5em;margin-right:0.5em;margin-bottom:0em;");

     $table=$div0->appendChild($domd0->createElement('table',""));
     $table->setAttribute("style","background:url('https://vcrxol.com/_otro/estadio.png') no-repeat center center;background-size: cover;");
     $table->setAttribute("border","0");
     $table->setAttribute("cellpadding","0");
     $tr=$table->appendChild($domd0->createElement('tr',""));
     $td=$tr->appendChild($domd0->createElement('th',$znombre));
     $td->setAttribute("colspan","8");
     $td->setAttribute("bgcolor","yellow");

     for ($fil=1; $fil<=9; $fil++)
         {
              $tr=$table->appendChild($domd0->createElement('tr',""));
              for ($col=1; $col<=9 ; $col++)
                  {
                      $color = '';
                      if ($zbase > 0)
                         {
                            if ($col==5 and $fil==2 and $zbase == 2) $color = "black";
                            if ($col==1 and $fil==5 and $zbase == 3) $color = "blue";
                            if ($col==9 and $fil==5 and $zbase == 1) $color = "red";
                         }
                      $td=$tr->appendChild($domd0->createElement('td',""));
                         $td->setAttribute("style","width:22px; height:22px;background-color:".$color.';');
                  }
         }


//$td->setAttribute("style","border:1px;border-style:solid;border-color:black;");
     
// $td->setAttribute("style","background-color:".$empr0['empr_color2 '].";");


//     $tr11=$table->appendChild($domd0->createElement('tr',""));
//     $tr12=$table->appendChild($domd0->createElement('tr',""));

//     $td=$tr12->appendChild($domd0->createElement('td',"celda xx"));
//     $td=$tr11->appendChild($domd0->createElement('td',"celda 41"));
echo $domd0->saveXML();

$znombre='';
?>



