Assuming I have this structure:
<div style="width:1000px">
<div id="div1" style=""></div>
<div id="div2" style="width:300px"></div>
</div>
How to make div1 exactly occupy the remaining space (700px)?
Preferably taking into account already possible margins of div1 and div2.
At first I would like to do this with CSS only, but if there is no solution it can be via javascript / jquery.
NOTE: I can not add extra html elements. Div2 has fixed width.
OBS2: The actual scenario is a Table cell. In that cell I have the input field that would be the "div1" in my example. And a small image of magnifying glass next to it, which would be the div2 with fixed size. I want these two elements to fit to take up all the cell space