Object-Oriented Programming, HTML Tables

Domain Modeling

  • Domain modeling is the process of creating a conceptual model in code for a specific problem. A model describes the various entities, their attributes and behaviors, as well as the constraints that govern the problem domain. An entity that stores data in properties and encapsulates behaviors in methods is commonly referred to as an object-oriented model.

  • A domain model that’s articulated well can verify and validate the understanding of a specific problem among various stakeholders. As a communication tool, it defines a vocabulary that can be used within and between both technical and business teams.

Modling

Tables

  • The <table> element is used to add tables to a web page.
  • A table is drawn out row by row. Each row is created with the <tr> element.
  • Inside each row there are a number of cells represented by the <td> element (or <th> if it is a header).
  • 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>,
, and . ![](https://cdn.educba.com/academy/wp-content/uploads/2019/10/Create-Tables-in-HTML.png) - The tag defines an HTML table. - Each table row is defined with a tag. Each table header is defined with a
tag. Each table data/cell is defined with a tag. - By default, the text in elements are bold and centered. - By default, the text in elements are regular and left-aligned. - To add a border to a table, use the CSS border property - 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. - To set the padding, use the CSS padding property: ### summary - Use the HTML element to define a table - Use the HTML element to define a table row - Use the HTML
element to define a table data - Use the HTML element to define a table heading - Use the HTML
element to define a table caption - Use the CSS border property to define a border - Use the CSS border-collapse property to collapse cell borders - Use the CSS padding property to add padding to cells - Use the CSS text-align property to align cell text - Use the CSS border-spacing property to set the spacing between cells - Use the colspan attribute to make a cell span many columns - Use the rowspan attribute to make a cell span many rows - Use the id attribute to uniquely define one table ------------------------------------------------ # Functions, Methods, and Objects #### JavaScript Objects In JavaScript, almost "everything" is an object. - Booleans can be objects (if defined with the new keyword) - Numbers can be objects (if defined with the new keyword) - Strings can be objects (if defined with the new keyword) - Arrays are always objects - Functions are always objects - Objects are always objects ![](https://www.tutsmake.com/wp-content/uploads/2020/05/JavaScript-Objects.jpeg) #### JavaScript Primitives A primitive value is a value that has no properties or methods. A primitive data type is data that has a primitive value. JavaScript defines 5 types of primitive data types: string number boolean null undefined Primitive values are immutable (they are hardcoded and therefore cannot be changed). --------------------------------------- #### JavaScript Methods JavaScript methods are actions that can be performed on objects. A JavaScript method is a property containing a function definition. You access an object method with the following syntax: objectName.methodName() You will typically describe fullName() as a method of the person object, and fullName as a property. The fullName property will execute (as a function) when it is invoked with (). This example accesses the fullName() method of a person object: ![](https://dmitripavlutin.com/static/d0597f7819971bf2b124b653b673eb29/05127/cover-2.png)