reading-notes

Class-07 reading Summary

Duckett HTML book Chapter 6 : Tables

A table represents information in a grid format. Examples of tables include financial reports, TV schedules, and sports results.

<table>
<tr>
<td>15</td>
<td>15</td>
<td>30</td>
</tr>
<tr>
<td>45</td>
<td>60</td>
<td>45</td>
</tr>
<tr>
<td>60</td>
<td>90</td>
<td>90</td>
</tr>
</table>

You can make cells of a table span more than one row or column using the rowspan and colspan attributes.

For long tables you can split the table into a <thead> , <tbody>, and <tfoot>.


Duckett JavaScript book Chapter 3 : Functions, Methods, and Objects

Functions let you group a series of statements together to perform a specific task. If different parts of a script repeat the same task, you can reuse the function (rather than repeating the same set of st atements).

A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when “something” invokes it (calls it).

function myFunction(p1, p2) {
  return p1 * p2;   // The function returns the product of p1 and p2
}
function name(parameter1, parameter2, parameter3) {
  // code to be executed
}

Objects:

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.

This code assigns many values (Fiat, 500, white) to a variable named car:

var car = {type:"Fiat", model:"500", color:"white"};

The values are written as name:value pairs (name and value separated by a colon).