Sunday, 15 January 2012

php - word wrap does not let the numbers wrap also -



php - word wrap does not let the numbers wrap also -

i have form working thing when user enters lot of digits textbox numbers

example:

12345678 3567892 1235674 36778883 566666678 35674748999 // no spaces

it not want wrap. looked on net shows how wrap text.

<html> <?php require_once("connect.php"); $stmt = $db->prepare("select * 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>

try designate width of table thru 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>

php mysql pdo

No comments:

Post a Comment