Html – tables

An HTML table is a feature includes of table rows and columns, much like you’d see while applying an application such as Excel. Tables are container features, and their only goal is to house other HTML features and order them in a tabular fashion — row by row, column by column.

Firstly, tables may seem difficult; however after working via this lesson, you’ll see that they aren’t so terrifying. A table feature includes of three various HTML tags including the <table> tag, <tr> (table rows), and the <td> (table columns) tags.

HTML Table Code:


Basic HTML Table Layout:

Row 1 Cell 1 Row 1 Cell 2
Row 2 Cell 1 Row 2 Cell 2

We’ve suited the formatting of the code by supplementing additional spaces before some of the table features, but this has no deportment on the submitting of the feature. Following each tag/feature will be possible and it helps us to make sure that we don’t avoid an opening or closing tag which would avoid our table feature from submitting correctly. We’ve also added a border characteristic to make sure that the table cells/rows are clearer to our observers.

Content features like HTML lists, images, and even other table features can be located within each table cell. Doing so straightens the features in a tabular fashion and presents structure.

HTML Table Code:


HTML Table 2:

  • List Item 1
  • List Item 2
  • List Item 3
  • List Item 4
  • List Item 5
  • List Item 6

Avoid losing floppy disks with important school...


Rather than stacking them up one on top of another, HTML tables provide the web designer with align page content in a tabular fashion while spanning features horizontally across the web page.

html – table rows & table columns

A table may include a limitless number of table rows. With an opening and closing tag (<tr> </tr>) each table row is fundamentally a table feature itself. Table columns are also regarded as child features of HTML tables, and like table rows, an HTML table may include a limitless number of table data cells (<td> <tr>).

As we’ve seen in previous examples table rows and columns are container features that house other HTML features such as text links, images, and lists. Below, In order to help recognize the various table features we’ve applied a background color to the table example.

HTML Table Code:


HTML Table Code Example:

Row 1 Cell 1 Row 1 Cell 2
Row 2 Cell 1 Row 2 Cell 2


Html – tables: spanning multiple rows and cells

In order to span multiple rows blend together table rows and colspan to span within multiple columns utilize rowspan.

HTML Table Rowspan Characteristic:


HTML Colspan and Rowspan Characteristics:

Column 1 Column 2 Column 3
Row 1 Cell 1 Row 1 Cell 2 Row 1 Cell 3
Row 2 Cell 2 Row 2 Cell 3
Row 3 Cell 1


Cell padding and spacing

You will be able to modify the spacing between table cells via cellpadding and cellspacing characteristics. Determining the cellpadding characteristic causing how much space will exist between a table cell border and the features included within it, whereas cellspacing determines how much space will exist between each table cell. In order to indicate these characteristics color has been supplemented to the table below.

HTML Cellpadding/Cellspacing Code:


HTML Cellspacing and Padding:

Column 1 Column 2
Row 1 Cell 1 Row 1 Cell 2
Row 2 Cell 1 Row 2 Cell 2


And now we will change the cellpadding of the table and delete the cellspacing from the previous example. This should clearly show the difference between cellpadding and cellspacing.

HTML Code:


HTML Cell Pads:

Column 1 Column 2
Row 1 Cell 1 Row 1 Cell 2
Row 2 Cell 1 Row 2 Cell 2

Browser explains spacing by a pixel value. So a value of 10 is simply 10 pixels wide. A pixel value is shown by most HTML characteristics that use numeric values for their measurements.

Leave a Reply

Your email address will not be published. Required fields are marked *