klionsms.blogg.se

Html tables
Html tables







You can view EDUCBA’s recommended articles for more information. We hope that this EDUCBA information on “HTML Table Tags” was beneficial to you. The examples have shown the usage of styling the table, nesting one table within another table, setting the height and width of the table, adding spacing and padding for the table cells, applying background color for the table, and many more. So far, we have studied the different types of table tags in HTML.

  • height: This attribute specifies the height of the table.
  • width: This attribute tells the width of the table.
  • summary: It provides what type of table content is present.
  • sortable: This attribute informs that the table is sortable.
  • rules: This specifies which parts of the inside borders are visible.
  • frame: It specifies which parts of the outside borders are visible.
  • cellspacing: This attribute indicates the space between table cells.
  • cellpadding: This attribute displays the padding between table cells and table content. There are a number of tags used in tables, and to fully get to grips with how they work is probably the most difficult area of this HTML Beginner Tutorial.
  • border: This attribute specifies the border for the table cells.
  • bgcolor: This attribute specifies the background color for the table.
  • align: This attribute provides content alignment inside an element.
  • Let us consider the below example for the nested table: You can use one table inside another table is called a nested table.

    HTML TABLES CODE

    You can set the height and width of the table by using the width and height attributes.Įxecute the above code you will have the below output: The table cell border can be specified by using the border-color attribute.Įxecute the above code, and it will display the below output: You can create the background of the table by using the bgcolor attribute.

    html tables

    The code will display the following output: You can merge two or more table rows into a single row by using the rowspan attribute, and you can merge table columns into a single column by using the colspan attribute. The cellpadding attribute distance between the table cell border and data. The table cells’ padding can be defined using the cellpadding attribute. The above code will display the following output: The cellspacing attribute specifies the space between table cells. The table cells’ space can be defined using the cellspacing attribute.

    html tables

    The above code will display the below output: The table caption can be specified using the tag. html extension and open it in the browser. Here are the Examples of HTML Table Tags given below 1.







    Html tables