reading-notes


Project maintained by mr-atta Hosted on GitHub Pages — Theme by mattgraham

HTML Tables
`<table>`

Tables

What’s a Table? ??

A table represents information in a grid format.

How to create tables ??

  1. <table>
  2. <tr>
  3. <td>
    •  HTML Tables

      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 …

There are characteristics of another, like:

Spanning ColumnS

to stretch across more than one column , <th></th> or <th></th>

Summary

  1. The <table> element is used to add tables to a web page.
  2. A table is drawn out row by row. Each row is created with the <tr> element.
  3. Inside each row there are a number of cells represented by the <td> element (or <th> if it is a header).
  4. You can make cells of a table span more than one row or column using the rowspan and colspan attributes.
  5. For long tables you can split the table into a <thead>, <tbody>, and <tfoot>.

# JS Objects
![js ](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQd-mbfdUrmeRr00MPj0rbbmO2rEnIwwiVkLQ&usqp=CAU)

creating an Object: constructor notation

constructor

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 constructor

Example

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;

this

ADDING AND REMOVING PROPERTIES

OBJECT MODEL

### 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.