xxxxxxxxxx
/* The backwards for loop is the same as
a regular for loop, You just change the three
parts the*/
// the start the stop -1 each time which is 3 in this case
for (let counter = 3; counter >= 0; counter--) {
console.log(counter);
}
/*with loops think of a cirle with a start, stop,
and then which way we are going forwards-> = the ++
or backwards <- = --*/
xxxxxxxxxx
const array = [6,7,8,9,10];
for (const number of array.reverse()) {
console.log(number);
}
xxxxxxxxxx
// Looping through reversely in a loop
var arr = [ 1,2,3,4,5];
for (let i = arr.length-1; i>=0; i--){
console.log(i);
}
//output = 5,4,3,2,1
xxxxxxxxxx
var arr = [1, 2, 3, 4, 5];
for (var i = arr.length - 1; i >= 0; i--) {
console.log(arr[i]);
}
xxxxxxxxxx
var arr = [1, 2, 3, 4, 5];
for (var i = arr.length - 1; i >= 0; i--) {
console.log(arr[i]);
}
xxxxxxxxxx
Responsive website, specify width
.container{
max-width:960px;
width:100%;
margin:0 auto;
}
xxxxxxxxxx
function seethestars1() {
for (var i = 0; i <= 10; i++) {
for (var j = 0; j < i; j++) {
document.getElementById("emptytext2").value += "*";
}
document.getElementById("emptytext2").value += "\n";
}
}
<textarea id="emptytext2" name="S2">
<input id="emptytext3" type="button" value="Click for the stars" onclick ="seethestars1()" />
xxxxxxxxxx
<div className="overflow-x-auto max-w-full">
<table className="w-full whitespace-no-wrap divide-y divide-gray-200">
<thead className="bg-gray-50">
<tr>
{xlsxData[0].map((header, index) => (
<th
key={index}
className="border border-gray-400 px-3 py-2 text-xs sm:text-sm md:text-base lg:text-lg xl:text-xl"
>
{header}
</th>
))}
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{xlsxData.slice(1).map((row, rowIndex) => (
<tr key={rowIndex}>
{row.map((cell, cellIndex) => (
<td
key={cellIndex}
className="border border-gray-400 px-3 py-2 text-xs sm:text-sm md:text-base lg:text-lg xl:text-xl"
>
<input
type="text"
defaultValue={cell}
onChange={(e) => handleInputChange(e.target.value, rowIndex, cellIndex)}
className="w-full bg-transparent focus:outline-none"
/>
</td>
))}
</tr>
))}
</tbody>
</table>
</div>