I am seeking a solution to make table cells responsive, creating even squares that fill all available space within the window. Currently, when the table width is set to 100%, it fills all available space by distributing cells evenly horizontally. I have implemented a small JavaScript function using jQuery which triggers on the window resize event:
function windowResize(){
$("td").each(function(){
$(this).css({"height":$(this).width()});
})
}
However, this approach has proven to be slow due to the high number of cells present. Can anyone suggest a more efficient method to achieve this effect using only CSS or any other faster alternative?