Tables and Frames in Web Designing

Tables and Frames in Web Designing

Tables and Frames in Web Designing

Introduction to Tables

Tables are an essential part of web designing. They are used to organize data in rows and columns, making it easier for users to read and understand information. In HTML, tables are created using the <table> tag.

Creating Tables

To create a basic table, you need to use the <table>, <tr> (table row), <th> (table header), and <td> (table data) tags. Here's an example:

    <table>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>
  

Attributes of Tables

Tables in HTML come with various attributes to customize their appearance and behavior. Some common attributes include:

  • border: Specifies the width of the border around the table.
  • cellpadding: Specifies the space between the cell content and cell border.
  • cellspacing: Specifies the space between cells.
  • width: Specifies the width of the table.
  • height: Specifies the height of the table.

Frames in Web Designing

Frames allow web designers to divide a webpage into multiple sections, each with its own HTML document. Frames are created using the <frame> and <frameset> tags.

Creating Frames

To create frames, you need to use the <frameset> tag to define the layout of the frames and the <frame> tag to specify the content of each frame. Here's an example:

    <frameset cols="25%, 75%">
  <frame src="menu.html">
  <frame src="content.html">
</frameset>
  

Attributes of Frames

Frames come with attributes to customize their behavior. Some common attributes include:

  • cols: Specifies the width of each column in a frameset.
  • rows: Specifies the height of each row in a frameset.
  • border: Specifies the width of the border around each frame.
  • scrolling: Specifies whether scrollbars should be displayed for frames with overflowing content.