使用插入服务器的数据自动填充表

时间:2018-05-29 15:38:13

标签: javascript html iframe

我已经手动创建了这个表,我希望“Dinamico”案例中的每个html文档都会自动出现在表格中。每当我有一个新的html页面时,它应该创建一个新的“tr”元素

 <table cellspacing="0" cellpadding="0" border="0" class="table">
        <tr>
            <th>Esquema de MetaDados</th>
            <th>Descrição</th>
        </tr>
        <tr>
        <td><a strong href="Templates/MetaDadosVideo/template_Video.html">Metadados Video</a></td>
        <td>Catalogação e arquivo de conteúdos de Videos de Concerto, entrevistas</td>
        </tr>
        <tr>
        <td><a strong href="Templates/MetaDadosGráficos/template_gráficos.html">Metadados Materiais Gráficos</a></td>
        <td>Arquivo de Materias Gráficos Finais</td>
        </tr>
        <tr>
        <td><a strong href="#">Metadados Porto 2001</a></td>
        <td>Conteudos da Porto 2001</td>
        </tr>
        <tr>
        <td><a strong href="Templates/Dinamico/formD1.html">Metadados Dinamico</a></td>
        <td>Conteudos da Porto 2001</td>
        </tr>
    </table>

当他选择模板时,带有“page.html”的iframe会更改为所选的用户选项。我怎样才能做到这一点?

<!DOCTYPE html>

<html id="the">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="../../CSS/form.css">

</head><body style="background-color:white;">
<script>
     var Nome; // Nome do esquema 
    var Desc; // descrição do esquema
    var temas = []; // Nome dos temas do form
    var fields = []; // nr de campos
    var FL= []; // Nome do campo
    var TF =[]; // tipo do campo
    </script>

    <div>
<iframe src="../../Resources/logo-cm__.png" frameBorder="0" width="30%" height="80px" align="left" scrolling="mo"
/>
    </iframe>
</div>
<div>
<iframe src="../../Resources/title.png" frameBorder="0" width="60%" height="80px" align="center" scrolling="no" />
</iframe>
</div>

<div>
<iframe src="page.html" frameBorder="0" width="70%" height="600px" align="left" scrolling="no" />    
</iframe>
</div>

<div>
<iframe src="../../galeria/frame2_galeria.html" frameBorder="0" width="29%" height="600px" align="right" scrolling="yes" />    
</iframe>
</div>
<a onclick="this.href='data:text/html;charset=UTF-8,'+encodeURIComponent(document.documentElement.outerHTML)" href="#" download="page.html">Download Template</a>
</body>

</html>

1 个答案:

答案 0 :(得分:0)

类似的情况,您可以在其中为每个html创建一个动态表,并为表的列提供文件名。在其中放置html文件存储的每个目录的路径

foreach (glob("omething*.htm") as $filename) {
              foreach(glob("Templates/Dinamico/*.txt") as $txtname){ 
               $fileH= basename($filename,".htm");  

            if($filename != "something.html"){ 
                echo'<tr>';
                echo'<td>';

                echo "<a name='".$fileH."'strong href='something.php?id=$fileH'>".$fileH."</a>";

                echo'</td>';
                echo'<td>';
                echo $txt;
                echo'</td>';
                echo'</tr>';