html - How to make the div width fit the table which inside the div? -
if table
inside div
, width of table uncertain, can wider screen width, how make div
containing table adjust table width? since div
has been set padding: 10px
, when table exceeds screen width, padding-right
turns invisible.
here code:
<div class="panel-body"> <table class="table table-hover table-bordered"></table> </div>
i found method.
.panel-body{ display: inline-block; padding: 10px; }
the key why can work "display".you learn differences block,inline,and inline-block. hope helps
Comments
Post a Comment