1

I have a table element in HTML which resizes dynamically. Whenever the table resizes, i want to perform some operations for rest of the application members to adjust themselves according to the table. How can I achieve it? Thanks in advance.

Agnivesh Reddy
  • 65
  • 2
  • 10

2 Answers2

0

You can use onresize attribute in your table

here is example

<table onresize="myFunction()">
 <thead>
 </thead>

 <tbody>
 </tboady>
<tablel>

Put function in script

<script>
myFunction() {
 alert('resize working');
}
</script>

Now you can work on myFunction whenever resize your table.

Hope this help you

Jalay Oza
  • 772
  • 7
  • 11
0

You can add an attribute to your table

<table onresize="yourFunction()">

yourFunction() - function which will be called, when table resizes.

Or you can do it in JavaScript , using the addEventListener() method:

object.addEventListener("resize", yourFunction);