Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t在PHP生成的表中设置TD高度_Php_Html_Forms_Html Table - Fatal编程技术网

Can';t在PHP生成的表中设置TD高度

Can';t在PHP生成的表中设置TD高度,php,html,forms,html-table,Php,Html,Forms,Html Table,我有一个表单,访问者可以在其中填写信息,在后端,我会创建一个页面,显示这些信息供客户端查看。该表是通过PHP填充的。在其中一个字段中,访问者可以输入多达3000个字符的叙述,因为这可能会很长,我想设置一个高度并添加一个滚动条。但是,我无法设置高度 PHP <?php get_header(); the_post(); ?> <h1>Prayer Requests</h1> <?php $mysqli = new mysqli('localhost'

我有一个表单,访问者可以在其中填写信息,在后端,我会创建一个页面,显示这些信息供客户端查看。该表是通过PHP填充的。在其中一个字段中,访问者可以输入多达3000个字符的叙述,因为这可能会很长,我想设置一个高度并添加一个滚动条。但是,我无法设置高度

PHP

<?php get_header(); the_post(); ?>

<h1>Prayer Requests</h1>

<?php

$mysqli = new mysqli('localhost', 'root', '', 'aln');
$query = $mysqli->prepare("SELECT `title`, `firstName`, `lastName`, `email`, `address`,     `city`, `state`, `zip`, `country`, `prayer`, `timestamp` FROM `prayerrequests` WHERE 1");
$query->execute();


$query->bind_result($title, $first, $last, $email, $address, $city, $state, $zip,     $country, $prayer, $timestamp)
?>
<table>
<tr><td class="header">Title</td><td class="header">First Name</td><td class="header">Last Name</td><td class="header">E-mail Address</td><td class="header">Address</td><td class="header">City</td><td class="header">State</td><td class="header">Zip Code</td><td class="header">Country</td><td class="header">Prayer</td><td class="header">Date Submitted</td></tr>
<?php
while($query->fetch()) {
echo "<tr><td>$title</td><td>$first</td><td>$last</td><td>$email</td><td>$address</td><td>$city</td><td>$state</td><td>$zip</td><td>$country</td><td>$prayer</td><td>$timestamp</td></tr>";
}
?>
</table>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

通常,您会将表格包装成一个DIV,然后调整DIV的大小并为其提供滚动条,而不是表格本身。

谢谢,我最后只是在叙述中添加了一个DIV,设置了该DIV的高度并添加了一个滚动条。
table {
margin: 0 auto;
border: 1px solid #000;
background: #32458b;
background: rgb(54, 79, 139);
background: rgba(54, 79, 139, 0.5);
border-spacing: 0;
border-collapse: collapse;
height: auto;
width: 1000px;
margin-bottom: 20px;
}

tr, td {
border: 1px solid #000;
color: #f1f1f2;
height: 200px;
overflow: scroll;
}

.header{
background: #32458b;
background: rgb(54, 79, 139);
background: rgba(54, 79, 139, 0.8);
}