html - Limit table cell to only one line of text? 'overflow' and 'white-space' not working -


fiddle

i have table w/ multiple columns , rows, , i'm trying limit each cell 1 line of text. second lines , beyond want hidden because multiple lines disrupt height of each table row.

first off, sells contain

tags, , following code not fixing issue:

table {     table-layout: fixed; }  td {     overflow: hidden;     white-space: nowrap;     width: 50px; } 

how can limit each cell 1 line of text?

nowrap works in table cells, using <br> forcing line break. enter long text spaces , see works fine:

<td><p>3 4 5 5 5 5 5 5 5 5 5 5 5</p></td> 

http://jsfiddle.net/unk64/

if put text-overflow:ellipsis; , strip <p> tags, can make end ...:

http://jsfiddle.net/unk64/2/

if wish ignore <br> in td, use css walkaround:

td br{     line-height: 0px;     display:none; } 

http://jsfiddle.net/unk64/5/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -