To generate an m x n grid in Bootstrap using Javascript, you can use the Bootstrap grid system to create a container and then add rows and columns dynamically using Javascript.
Here's an example function that generates an m x n grid in Bootstrap:
1503 chars51 lines
In this example, the generateGrid
function creates a Bootstrap container and then dynamically adds rows and columns to create an m x n grid. The function takes two arguments, m
and n
, to specify the number of rows and columns in the grid. The id
attribute of the container is used to select it using document.getElementById
in the function. The innerHTML of each column is set to a string that indicates its position in the grid. Finally, the generateGrid
function is called with the desired number of rows and columns to generate the grid dynamically in Javascript.
gistlibby LogSnag