html - Make container div expand to size of inner contents using table-cell display -


seems pretty standard problem: need container div element expand horizontally according width property of inner fieldset. i've found far offers 2 solutions.

first solution use display:inline-block. however, i'm using display:table-cell position container won't work.

the second add min-width container div. solve issue, width of inner fieldset not static, while looks fine when there's lot of content in fieldset looks awkward otherwise (there huge gap between particular div , 1 it's right).

is there way force container div automatically resize, based on inner content, without using 2 solutions above?

fiddle: http://jsfiddle.net/mj3h1682/

edit

added following script page. method using css, if knows of one.

<script type="text/javascript">     $(document).ready(function() {         var width = $('#profile').outerwidth() + 20;         $('#partialcolumn1').css('min-width', width);     }); </script> 


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -