Trying to create a responsive webpage has been a bit challenging. I experimented with height
,style.height
, style.OffsetHeight
, etc. but still struggling to dynamically make a square table.
Although the code below changes the height, the table's width and height do not align.
var width = table.offsetWidth;
table.setAttribute("style","height:"+ width + "px;");
- Should the logic be applied to cells or the table itself?
- How can text (font-size) and other elements be made responsive?
- Is there a way to calculate 60% of the screen height so the minimum of width and height can be set as the table parameters?
Design Pattern : Design
Code : jsfiddle
Thank you in advance.