...

View Full Version : Change table>tbody dinamically



yvorl
06-02-2009, 01:13 PM
Hi!

Here's my problem:

I've got a CSS like:



...
table>tbody {
overflow: auto;
height: ...
...
}

and:


<div id="table" class="tableContainer">
<table cellspacing="0">
<thead>
..
..
</thead>
<tbody>
..
..
</tbody>
</table>
</div>

Is it possible to change the height of '<tbody>'?

For example:

var x = document.getelemen(s)tby.... something??
x.stlye.height = 100 + 'px';

the css part sould be untouched (it's part of a fixed header table solution)

Thank you

VIPStephan
06-02-2009, 01:29 PM
If you can change the height of tbody with CSS then you can change it with JavaScript, too, yes.

Are you actually asking if or how it’s possible to change it?

yvorl
06-02-2009, 01:35 PM
Sorry, my question is how it's possible to change it with javascript.

Thanks for the help

yvorl
06-02-2009, 02:26 PM
Problem solved.

If anybody interested:



var tbody = document.getElementsByTagName('tbody')[0]
tbody.style.height = 1000 + 'px';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum