I need it very simply, or at least it should be, but after several days of research, I came to go to stackoverflow if anyone really knows how to do this ...
I have 3 columns of content, all of which have extensible content inside. Not a single content is very wide, but it is a lot (once expanded). I need to do this so that when expanding the content in one column, it reduces the other two columns to a certain amount, and when you expand the content of two columns, it is aligned, etc. Then the columns must have a percentage of maximum size and minimum size (in percent or static), so when the columns expand, they do not completely hide the rest, and therefore I can set the maximum “extensibility” for each column. For simplicity, here is an example that would do the trick if it only worked:
<table width="100%"><tr>
<td style="min-width:200px; max-width:60%;">Col1ExpandableContent</td>
<td style="min-width:200px; max-width:50%;">Col2ExpandableContent</td>
<td style="min-width:200px; max-width:40%;">Col3ExpandableContent</td>
</tr></table>
The above code does not work, but I'm sure you can imagine how it will work if it does. This is exactly what I need, only that max-width for some reason does not work with percentages on TD. If you need better visualization, I made a fiddle to help illustrate the problem here: http://jsfiddle.net/m5xgcf3s/
cols - , , . , ( , TD , ) , (, , ). , javascript, , , , . , , heck max-width ...
:
, , script, ... NO frameworks, NO jQuery, NO hacks, TDs id ;
<script type="text/javascript">
window.onresize=function setTDmaxwidth() {
var containerwidth = window.innerWidth;
if (containerwidth >= 400 ) {
document.getElementById("col1").style.maxWidth=( ( containerwidth * 0.6 )+'px');
document.getElementById("col2").style.maxWidth=( ( containerwidth * 0.5 )+'px');
document.getElementById("col3").style.maxWidth=( ( containerwidth * 0.4 )+'px');
} else { }
}
</script>
, , ( 100% iframe). , ( ), , , , TDs