ch6: Tables

  • A table represents information in a grid format.
  • tags used to create table:
    • :(The tr stands for table row.)
    • :(The td stands for table data.)
    • element is used just like the element but its purpose is to represent the heading for either a column or a row. (The th stands for table heading.) , colunm heading
    • The headings of the table should sit inside the element.
    • The body should sit inside the element.
    • The footer belongs inside the element.

    ###

    • WAYS TO CREATE OBJECTS: 1- LITERAL NOTATION : ex var hotel = {} hotel .name= ‘Quay’; hotel .rooms = 40; hotel.booked = 25; hotel.checkAvailabil ity =function() return this.rooms - this .booked; } ;

    2- OBJECT CONSTRUCTOR NOTATION : ex var hotel = new Object(); hotel.name = ‘Quay’; hotel .rooms = 40; hotel . booked= 25; hotel.checkAvailability =function() return this .rooms - this.booked; } ;

  • typeof Arrays are objects, hold set of value pairs, but the key for each value is its index number.

  • JavaScript also has several built-in objects such as String, Number, Math, and Date. Their properties and methods offer functionality that help you write scripts.