How to implement dynamic modal pop-up size?

0
Hu all, I am working with modal pop up that show information from database, Now I fix pop up size to 800x600 pixels which enough for 6 rows. If data from data is less than 6 rows I would like to resize modal for 800x300 pixels. How can I do?    Thanks, Somboon
asked
2 answers
0

Hi Somboon,
you can implement dynamic modal pop-up size using modal-dialog class
and have look on this eg: https://www.codeply.com/go/bp/88364

.modal-dialog{
    position: relative;
    display: table; /* <-- This makes the trick */
    overflow-y: auto;    
    overflow-x: auto;
    width: auto;
    min-width: 300px;   
}

hope it helps!!.

answered
0

Hi Somboon,

As Narendran j said you have to set width auto and min-width for modal-dialog class.

it will be affect the whole application

width: auto;

min-width: 300px;

 

answered