Currently, I am working on designing a grid layout for my application with an uncertain number of columns. My goal is to adjust the width of these columns dynamically based on the number of items rendered in the li
elements generated by the Angular code on the client side.
For this project, using any external libraries is not an option.
li {
display: block;
float: left;
width: calc(~'(100% - 30px)/n');
padding-left: 25px;
text-align: center;
}
I am wondering if there is a method to automatically count the number of <li>
elements within a <ul>
container dynamically.