user4310642
user4310642

Reputation: 35

HTML table content: how to show part of content in new line if the line is lengthy

I have a HTML content like

<Table style="width=100px;">
<tr>
<td>
KEY1:Value1 Key2:Value2
</td>
<tr>
<Table>

Now if my td content is longer than the TD width, it should show like
Key1: value1
Key2: value2

Note: this should be applicable only if the content length is higher than the TD width Also, this is needed for IE6

Upvotes: 0

Views: 213

Answers (1)

Aravind Bharathy
Aravind Bharathy

Reputation: 1610

Set table-layout:fixed for table and word-wrap:break-word in the td.

table{
    width:100px;
    table-layout:fixed;
}

td{
    word-wrap:break-word ;
}

Working fiddle here

Upvotes: 1

Related Questions