foreach ($perfiles as $key => $valor) {
     $p->AddPage('P');
     $p->SetMargins(3, 10, 0);
     $p->titulo(5, $titulo);
     $p->setfont('Arial', '', 8);
     $p->SetTitle(date("d-m-Y") . "_informe");
     $p->SetFillColor(166, 166, 166);
     $p->SetTextColor(255, 255, 255);
     $p->SetDrawColor(0, 0, 0);
     $p->Cell(204, 10, "PERFILES DE PUESTO", 1, 1, "C", true);
     $p->Ln(5);
     $p->SetFillColor(255, 255, 255);
     $p->SetTextColor(175, 175, 175);
     $p->Cell(180, 10, "" . html_entity_decode("Denominación del puesto") . "", 0, 1, "LB");
     $p->SetTextColor(0, 0, 0);
     $p->SetFontSize(15);
     $p->Cell(180, 5, $valor['nombre'], 0, 1, "L");
     $p->Ln(8);
     $p->SetFontSize(10);
     $p->SetTextColor(175, 175, 175);
     $p->Cell(80, 10, "Funciones", 0, 1);
     $p->SetTextColor(0, 0, 0);
     $tabla = "<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $valor['funciones'] . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>";
     $p->htmltable($tabla);
     $p->Ln(8);
     $p->SetFontSize(10);
     $p->SetTextColor(0, 0, 0);
     $p->SetTextColor(175, 175, 175);
     $p->Cell(80, 10, "" . html_entity_decode("Formaci&oacute;n requerida") . "", 0, 0);
     $p->Cell(20, 10, "", 0, 0);
     $p->Cell(80, 10, "Experiencia requerida", 0, 1);