Object-Oriented Programming, HTML Tables
Tables” (pp.126-145)\
- A table represents information in a grid format
- The < table> element is used to create a table
- You indicate the start of each row using the opening < tr> tag.
- Each cell of a table is represented using a < td>
- The < th> element is used just like the < td> element but its purpose is to represent the heading for either a column or a row
- Even if a cell has no content, you should still use a < td> or < th>
- There are three elements that help distinguish between the main content of the table and the first and last rows
- The headings of the table should sit inside the < thead> element.
- The body should sit inside the < tbody> element.
- The footer belongs inside the < tfoot> element.
Functions, Methods, and Objects” (pp.106-144)
- you can create a new pbject by using new keyword and Object().
- you can then proceeed by adding new properties and methods to it using dot notation
- The keyword this is commonly used inside functions and objects. Where the function is declared alters what this means. It always refers to one object, usually the object in which the function operate
- When a function is created at the top level of a script (that is, not inside another object or function), then it is in the global scope or global context.
- If a named function has been defined in global scope, and it is then used as a method of an object, this refers to the object it is contained within.
- When a function is defined inside an object, it
becomes a method. In a method, this refers to the containing object.
-Arrays can store multiple pieces of information. Each piece of information is separated by a comma. The order of the values is important because items in an array are assigned a number (called an index).
Back to main