Saturday, 15 August 2015

html - HTM table width expansion difficulty -



html - HTM table <td> width expansion difficulty -

i have been having difficulties in section of web page, can see lot of test words. trying create height of td auto whenever message submit width won't expand. i've been limiting width property not working, have tried having display block in css doesn't help @ all, best way resolve problem? here image: http://img209.imageshack.us/img209/4439/errrorx.png

this code table

<table class="itemlist" width="100%" cellspacing="1" cellpadding="4"> <tr class="det_msg"> <td><?php echo $detail ?></td> </tr> </table>

here code css

.det_msg td{ margin:6px; width:920px; color: #fff; border-bottom:1px solid #333; font-family:arial; font-size: 12px; color: #000000; margin-left:100px; padding:50px; }

here solution:

.itemlist { table-layout:fixed; } .det_msg td{ word-wrap: break-word; word-break: break-all; }

jsfiddle demo: http://jsfiddle.net/nkfnf/1/

but in actually, problem inserted unbelievable long "word" (no white space) td. hard browser break right, wasn't broken, displayed in 1 line.

so that, improve solution: create sure won't display such "long word" on web.

html css

No comments:

Post a Comment