View on GitHub

reading-notes

Reading notes for Codesfellows Coding

Reading Class 07

Dom article

15 15 30
45 60 45
60 90 90
- tr = table row
- td = table data
- th = heading
- spaning 
```html
<table>
 <tr>
 <th></th>
 <th>9am</th>
 <th>10am</th>
 <th>11am</th>
 <th>12am</th>
 </tr>
 <tr>
 <th>Monday</th>
 <td colspan="2">Geography</td>
 <td>Math</td>
 <td>Art</td>
 </tr>
 <tr>
 <th>Tuesday</th>
 <td colspan="3">Gym</td>
 <td>Home Ec</td>
 </tr>
</table>
ABC BBC CNN
6pm - 7pm Movie Comedy News
7pm - 8pm Sport Current Affairs
- long tables 
```html
<table>
 <thead>
 <tr>
 <th>Date</th>
 <th>Income</th>
 <th>Expenditure</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <th>1st January</th>
 <td>250</td>
 <td>36</td>
 </tr>
 <tr>
 <th>2nd January</th>
 <td>285</td>
 <td>48</td>
 </tr>
 <!-- additional rows as above -->
 <tr>
 <th>31st January</th>
 <td>129</td>
 <td>64</td>
 </tr>
 </tbody>
 <tfoot>
 <tr>
 <td></td>
 <td>7824</td>
 <td>1241</td>
 </tr>
 </tfoot>
</table>

JS

Chapter 3: “Functions, Methods, and Objects” (pp.106-144)



function contentCreator(elementType, content){

  var element = document.createElement (elementType);

  element.textContent = content;

  return element;
}

var paragraph = contentCreator('p','some text');

var divElement = document.getElementId('content-box');

divElement.appendChild(paragraph);

//EXAMPLE OOP//
var seattle={


}
//constructor
function Store(){

  this.name = 'seattle';
  this.hours = [6,7,8]
}

Store.prototype.speak = function(){


}

var seattle = new Store();