Option 1:
surround your cell contents with a
SPAN
tag, add a css class
cellContent
to it, as shown below.
Following sample code works only if your table do not contain any images whose size exceeds the size of the parent DIV container.
<style type="text/css">
.MYDIV {
width: 150px;
border: 1px solid black;
}
.cellContent {
word-break: break-all;
}
</style>
<div class="MYDIV">
<table>
<tr>
<td>very very long column data asdfiu asdflaasdufyasidyfa asdhf lasdlf <span></span></td>
<td>very very long column data aiwieyqwrepqywepryq pwe <span></span></td>
<td>very very long column data aldsfalsdkjflakslfda </td>
</tr>
</table>
</div>
Option 2:
add style:
overflow
in your DIV if you are comfortable with the scrollbars being shown .
<style type="text/css">
.MYDIV {
width: 150px;
overflow: auto;
border: 1px solid black;
}
</style>
Thanks & Regards,
Niral Soni