A table represents information in a grid format.
<table>
<tr>
<td>
In the
<table>
we have<tr>
it is the row.And inside the<tr>
have<td>
had the data. One piece of the row is called a cell.
You can add css to the Table (inside or outside “better”) to add lines.such as : border , width (to rows) , color …
<caption>
, described the table , be after the <table>
tag.<th>
, is changing the cell to the default title(centered , bold).<thead>
, table head for groups of <td>
.<tfoot>
, table footer for groups of <td>
.
to stretch across more than one column ,
<th>
</th>
or<th></th>
<table>
element is used to add tables to a web page.<tr>
element.<td>
element (or <th>
if it is a header).<thead>
, <tbody>
, and <tfoot>
.# JS Objects
![js ](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQd-mbfdUrmeRr00MPj0rbbmO2rEnIwwiVkLQ&usqp=CAU)
constructor should make our live a piece of cake.
- when we have very much objects , And we need to make change on them, we can not old way to creating an Object (use constructor).
- used Method (or function).
- It is easy to change the code.
- On the right, an empty object called hote 1 is created using the constructor function. Once it has been created, three properties and a method are then assigned to the object. ( If the object already had any of these properties, this would overwrite the values in those properties.) To access a property of this object, you can use dot notation,just as you can with any object. For example, to get the hotel’s name you could use: hotel .name
function Hotel (name, rooms, booked) {
this .name = name;
this.rooms = rooms;
this.booked = booked;
this.checkAvailability = function()
return this.rooms - this.booked;
} ;
var quayHotel
var parkHotel
new Hotel('Quay', 40, 25);
new Hotel( ' Park', 120, 77);
var details!= quayHotel .name + ' rooms : ';
detailsl += quayHotel.checkAvailability();
var elHotell = docurnent.getElementByid('hotell');
elHotell.textContent =details!;
var details2 = parkHotel .name+ ' rooms: ';
detai l s2 += parkHotel.checkAvailability();
var e1Hotel2 = document.getEl ementByid('hotel2');
elHotel2.textContent = details2;
To delete a property, you use the keyword delete, and then use dot notation to identify the property or method you want to remove from the object.
In JavaScript, an array can hold different types of data types in a single slot, which implies that an array can have a string, a number or an object in a single slot.
### THE BROWSER OBJECT MODEL:THE WINDOW OBJECT
### GLOBAL OBJECTS: STRING OBJECT
### MATH OBJECT TO CREATE RANDOM NUMBERS * To get a random whole number between 1 and 10, you need to multiply the randomly generated number by 10. This number will still have many decimal places, so you can round it down to the nearest integer.