JSFiddle - React, Tailwind, and code Playground
by shahrukh007
HTML
<html>
<body>
<h2>Print Table</h2>
Enter No of Col:<input type="number" id="col_id">
<br>
Enter No of Row:<input type="number" id="row_id">
<br>
<button type="button" onclick="myFunction();">click me!</button><br>
<div id="dvTable">
</div>
<script>
function myFunction(){
var elements_array = [];
var result ="";
var tempArray = [];
var x= document.getElementById("col_id").value;
var y= document.getElementById("row_id").value;
var table = document.createElement("TABLE");
table.border = "1";
for(var i=1; i <=x; i++){
var row = table.insertRow(i-1);
for (var j=1; j<=y; j++){
result=(i*j);
// elements_array.push(result);
var cell = row.insertCell(j-1);
cell.innerHTML = result;
}
}
var dvTable = document.getElementById("dvTable");
dvTable.innerHTML = "";
dvTable.appendChild(table);
}
</script>
</body>
</html>
JavaScript
if(res){
if(this.state.pageCount != this.state.activePage){
this.getFlags('byo-flag/?b_y_o='+this.state.byodetail.id+'&page=' + this.state.activePage)
}
else{
this.state.byodetail.pageCount=this.state.byodetail.pageCount-1;
this.state.byodetail.activePage=this.state.byodetail.activePage-1;
this.state.lst_flags.splice(index, 1);
this.state.lst_flags.length == 0 ? this.setState({activePage:this.state.activePage,byodetail:this.state.byodetail},() => this.getFlags('byo-flag/?b_y_o='+this.state.byodetail.id+'&page=' + this.state.activePage)) : this.setState({lst_flags:this.state.lst_flags,byodetail:this.state.byodetail});
}
}