3

I have some text in table column which is greater than the column width I want. So text is overflowing from it. So I apply overflow:auto but in this case it is showing scroll on every page where data is less than the width of the column.

I don't want to show the scroll on that page where data is less than the width of column just want to show only where data is greater than its length.

Does any one have some suggestions?

<td  style=" width:50%;overflow:auto;>    
stema
  • 85,585
  • 19
  • 101
  • 125
BASEER HAIDER JAFRI
  • 919
  • 1
  • 16
  • 34

2 Answers2

2

Try to wrap td content in div with fixed width and overflow: auto

For example:

<table>
  <tr>
    <td>some content</td>
    <td>  <!-- your fixed width column -->
       <div style="width: 100px; overflow: scroll;">
          Loremipsumdolorsitametconsectetuadipisicingelit
       </div>
    </td>
  </tr>
</table>
rogal111
  • 5,804
  • 2
  • 26
  • 33
1
use this <td  style=" width:50%;overflow:scroll;"> 
This will insert horizontal and vertical scrollbars.
They will become active only if the content requires it.
dku.rajkumar
  • 18,048
  • 7
  • 40
  • 58