i want to resize dynamically table cols.
But some strange behaviour occurs under mozilla.
I cannot resize a col smaller than the largest element, even with overflow
hidden and table-layout fixed.
With one exception:
Inserting a initial css table-width like 10px in the html. In this case i
can resize to smaller sizes.
I can live with that (need to calc all td widths, set each and then put the
table to 1px),
but why can't i add this table width dynamically after rendering, to allow
shrinking?
I don't want to modify the html/css, as it comes from an other engine. Just
Javascript DOM.
Does anybody knows a hint, how to resize all tables in the way of the first
example without any hardcoded HTML-CSS.
Allowing shrink to zero under mozilla ?
the example:
***************************************
<head>
<style>td{ overflow:hidden}</style>
<script>
function mod(ob, siz){
var tab = document.getElementById(ob);
tab.style.tableLayout = "fixed";
tab.style.width = "1px"; // does not work in mozilla
var tds = tab.getElementsByTagName("TD"); //just to simplify the example
tds[0].style.width= siz+"px";
tds[0].style.color="red";
tds[1].style.width= "50px";
tds[1].style.color="blue";
}
</script>
</head>
<body>
<br />
first example this way it should be: <a
href='javascript:mod("t1",10);'>10px</a> <a
href='javascript:mod("t1",200);'>200px</a><br />
<table id='t1' style='width:20px;table-layout:fixed; '
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>
<br />second example only larger works: <a
href='javascript:mod("t2",10);'>10px</a> <a
href='javascript:mod("t2",200);'>200px</a><br />
<table id='t2' style='table-layout:fixed;'
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>
<br />any unknown table: <a href='javascript:mod("t3",10);'>10px</a> <a
href='javascript:mod("t3",200);'>200px</a><br />
<table id='t3'
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>
</body>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----