0

私はコードを持っています...サーバー側で、ヘッダーが垂直になるようにロードできないようです。以下のコードを試しました。

<?php
require 'include/DB_Open.php';

$ea_name = $_POST['ea_name'];

$sql="SELECT * FROM ea_error WHERE ea_name = '" . $ea_name . "'";

$myData = mysql_query($sql) or die(mysql_error());

//to count if there are any results
$numrow = mysql_num_rows($myData) ;

if($numrow == 0)
{
    echo "No results found.";
}
else
{
echo '<fieldset><legend><strong>Information</strong></legend>
<table width="auto" border="0" align="center">
<tr><th scope="row">Error</th></tr>
<tr><th scope="row">Resolution</th></tr>
<tr><th scope="row">Contact/s</th></tr>';

while($info = mysql_fetch_array($myData)) 
{
echo "<form action='retrieve.php' method='post'>";
echo  "<td align='center'>" . "<textarea readonly=readonly name=error cols=75 rows=8> " . $info['error'] . "</textarea></td>";
echo  "<td align='center'>" . "<textarea readonly=readonly name=resolution cols=75 rows=8> " . $info['resolution'] . "</textarea></td>"; 
echo  "<td align='center'>" . "<textarea readonly=readonly name=contacts cols=75 rows=8> " . $info['contacts'] . "</textarea></td>"; 
echo "</form>";
echo "</table>";
}
}
echo "</fieldset>"; 

include 'include/DB_Close.php';
?>

このコードで表示されるものは以下のようなものです

エラー

解像度

連絡先

次に、ここに3つのテキスト領域を1行に配置します

私がしたいことは

エラー - テキストエリア

解像度 - TEXTAREA

連絡先 - TEXTAREA

助けてください...私もCSSスタイルを無駄に使用しようとしました

table, td, th {
  border: 1px solid red;   
}

thead {
  float: left;   
}

また、以下のコードを使用しようとしましたが、

echo "<form action='retrieve.php' method='post'>";
echo "<tr>";
echo  "<td align='center'>" . "<textarea readonly=readonly name=error cols=75 rows=8> " . $info['error'] . "</textarea></td>";
echo "</tr>";
echo "<tr>";
echo  "<td align='center'>" . "<textarea readonly=readonly name=resolution cols=75 rows=8> " . $info['resolution'] . "</textarea></td>"; 
echo "</tr>";
echo "<tr>";
echo  "<td align='center'>" . "<textarea readonly=readonly name=contacts cols=75 rows=8> " . $info['contacts'] . "</textarea></td>"; 
echo "</tr>";

しかし、私が得ているのは

エラー

解像度

連絡先

テキストエリア

テキストエリア

テキストエリア

4

1 に答える 1

0

質問を正しく理解していれば、これが答えになる可能性があります(ただし、表形式のデータだけでなく、レイアウト設計に表を使用することは完全に避けます):

$myRes = "<form action='retrieve.php' method='post'>
        <fieldset>
            <legend><strong>Information</strong></legend>
            <table width='auto' border='0' align='center'>
                <tr>
                    <th scope='row'>Error</th>
                    <td align='center'><textarea readonly=readonly name=error cols=75 rows=8>" . $info['error'] . "</textarea></td>
                </tr>
                <tr>
                   <th scope='row'>Resolution</th>
                   <td align='center'><textarea readonly=readonly name=resolution cols=75 rows=8>" . $info['resolution'] . "</textarea></td>
                </tr>
                <tr>
                    <th scope='row'>Contact/s</th>
                    <td align='center'><textarea readonly=readonly name=contacts cols=75 rows=8>" . $info['contacts'] . "</textarea></td>
                </tr>
            </table>
        </fieldset>
    </form>";

echo $myRes;
于 2013-07-18T13:25:37.413 に答える