0

How to make table width adaptive? That means, if there is enough room, make it 100%; if the table is too wide and it is clipped, make it auto so that the table columns will not be clipped.

<div>

   <table class="adaptive-table">

   </table>

</div>

Is there a way using CSS? Thanks

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Dave
  • 759
  • 2
  • 9
  • 31

1 Answers1

0

If you want use pure CSS this may help you. Set for table.

table-layout: fixed;
width: 100%;

Now, if your table will be too wide, you can scroll td with option overflow: auto;

J. Key
  • 11
  • 1