-1

単独で適切に動作する PHP ファイルがありますが、file.php と呼ばれるホームページの特定の部分で実行する必要があります。

myfile.php を file.php 内で実行したいのですが、必要な場所のコンテナーを適切に div して動作を試しました<?php include("myfile.php"); ?>が、自動サイズが必要です。

myfile.php に幅のサイズが 900px のテーブルがあるとしますが、file.php を開くと myfile.php 内のテーブルのサイズが小さくなります。サイズは900px以下になります。divコンテナを使用してfile.php内で実行されるmyfile.php内のテーブルを900pxにする方法は?

4

4 に答える 4

1

PHPの「インクルード」を使用できます

<div id="container">
<?php include("myfile.php"); ?>
</div>

ちなみに、サイズをどうしたいのかというと、PHPではなくCSSが必要になると思います。

たぶんこの先

myfile.php

<table style="width:900px">
<tr><td></td></tr>
</table>
于 2013-04-16T11:13:41.840 に答える
0

file.phpで

include "path/to/myfile.php";

于 2013-04-16T11:11:52.533 に答える
0

このコードindex3.phpとdiv

<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JS Change Class</title>
<script language="JavaScript" src="js/adspreview.js"type="text/javascript" xml:space="preserve"></script>

<div id="container">
        <td><?php include("test.php"); ?>
</div>
</html>

ここで、index3.php内で実行したいコード

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Test</title>
</head>

<body>

<table border="1" width="100%">
    <tr>
        <td bgcolor="#0000FF" colspan="2">
        <p align="center"><font color="#FFFFFF" face="Arial"><b>Test</b></font></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

</body>

</html>

試してみてください、私はこれについて混乱しています。ご協力ありがとうございました。

于 2013-04-17T06:48:29.263 に答える