Php word wrap不允许数字也自动换行
我有这个表单,它正在工作唯一的事情是当用户在文本框中输入大量数字时 例如:Php word wrap不允许数字也自动换行,php,mysql,pdo,Php,Mysql,Pdo,我有这个表单,它正在工作唯一的事情是当用户在文本框中输入大量数字时 例如: 12345678 3567892 1235674 36778883 566666678 35674748999 // with no spaces 它不想包装。我浏览了整个网络,它只显示了如何包装文本 <html> <?php require_once("connect.php"); $stmt = $db->prepare("SELECT * FROM numbers"); $stmt-
12345678
3567892
1235674
36778883
566666678
35674748999
// with no spaces
它不想包装。我浏览了整个网络,它只显示了如何包装文本
<html>
<?php
require_once("connect.php");
$stmt = $db->prepare("SELECT * FROM numbers");
$stmt->execute();
?>
<?php while( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { ?>
<table border='1'table-layout: fixed >
<br>
<tr>
<th>Id</th>
<th>numbers</th>
</tr>
<tr>
<td style="word-wrap: break-word;"><?php echo $row['numbers']; ?></td>
</tr>
<?php } ?>
</table>
</body>
</html>
身份证件
数字
尝试通过css指定表格的宽度
<table border="1" style="table-layout: fixed; width: 150px;">
<tr>
<th>Id</th>
<th style="word-wrap: break-word;">numbers</th>
</tr>
<?php while( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { ?>
<tr>
<td style="word-wrap: break-word;"><?php echo $row['id']; ?></td>
<td style="word-wrap: break-word;"><?php echo $row['numbers']; ?></td>
</tr>
<?php } ?>
</table>
身份证件
数字
它最后应该是什么样子?只是一个带有表格的结果页。问题是数字使表格一直向右移动,而不是包装。如果只是为了输出,可以将它们转换为字符串吗?此外,表的标题比TDs多。