Skip to content

Latest commit

 

History

History
48 lines (25 loc) · 2.02 KB

File metadata and controls

48 lines (25 loc) · 2.02 KB

HTML Tables

Tables

HTML tables allow web developers to arrange data into rows and columns.

The < table > tag defines an HTML table.

Each table row is defined with a < tr > tag. Each table header is defined with a tag. Each table data/cell is defined with a < td > tag.

By default, the text in < th > elements are bold and centered.

By default, the text in < td > elements are regular and left-aligned.

Cell padding specifies the space between the cell content and its borders.

If you do not specify a padding, the table cells will be displayed without padding.


JavaScript

Functions, Methods, and Objects

A method is a function associated with an object, or, put differently, a method is a property of an object that is a function. Methods are defined the way normal functions are defined, except that they have to be assigned as the property of an object.

Object

The this Keyword

In a function definition, this refers to the "owner" of the function.

this.firstName means the firstName property of this object.

Conclusion

  • Functions allow you to group a set of related statements together that represent a single task.

  • Functions can take parameters (informatiorJ required to do their job) and may return a value.

  • An object is a series of variables and functions that represent something from the world around you.

  • In an object, variables are known as properties of the object; functions are known as methods of the object.

  • Web browsers implement objects that represent both the browser window and the document loaded into the browser window.

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

  • Arrays and objects can be used to reate complex data sets (and both can contain the other).