<abbr id="csyk0"></abbr>
<dfn id="csyk0"></dfn>
  • <table id="csyk0"></table>
  • \n\n\n\n
    Product<\/th>\nPrice<\/th>\n<\/tr>\n
    Apple<\/td>\n$20<\/td>\n<\/tr>\n<\/table>\n<\/body>\n<\/html><\/pre>\n

    Output:<\/strong>
    \nThe resultant table for product and price will be displayed as seen below:
    \n\"Create<\/p>\n

    To add an additional column to the table in the example, you can use the

    element within your table’s column. This element is used to define header cells for the column.<\/p>\n

    And if you want to add a new row to the table, you can use the

    element. This element is used to define regular cells within the table row.<\/p>\n

    Code:<\/strong><\/p>\n

    \n\n\n\n
    Product<\/th>\nPrice<\/th>\nQuantity<\/th>\n<\/tr>\n
    Apple<\/td>\n$20<\/td>\n10<\/td>\n<\/tr>\n
    Orange<\/td>\n$10<\/td>\n15<\/td>\n<\/tr>\n<\/table><\/pre>\n

    Output:<\/strong>
    \n\"Create<\/p>\n

    Let’s see how to add borders to an HTML table. This is a way to visually separate the different sections of the table and make it easier to read and understand.<\/p>\n

    Example 2: Table with Borders and Padding<\/h4>\n

    In this example, we will add a table element and set the border and cellpadding attribute. We will use the border attribute and set the width of the table’s border to 1 pixel. For the cellpadding attribute, we will use 5 pixels of padding for the content inside each cell.<\/p>\n

    Code:<\/strong><\/p>\n

    \n\n\n\n tag. For instance, you can use style=”background-color: #33cccc;” to set the background color to a nice shade of teal.<\/p>\n

    Code:<\/strong><\/p>\n

    Name<\/th>\nAge<\/th>\nCountry<\/th>\n<\/tr>\n
    Michael<\/td>\n27<\/td>\nAlaska<\/td>\n<\/tr>\n
    Evelyn<\/td>\n32<\/td>\nOhio<\/td>\n<\/tr>\n<\/table><\/pre>\n

    Output:<\/strong>
    \n\"Create<\/p>\n

    Example 3: Table with Styling<\/h4>\n

    If you want to improve the appearance of your table, you can use CSS (Cascading Style Sheets) to add various styles and formatting.<\/p>\n

    One way to enhance the table is by giving different cells a background color. To do this, you can simply add the style attribute with the background-color property inside the opening

    \n\n\n\n
    Country<\/th>\nPopulation<\/th>\nCapital<\/th>\n<\/tr>\n
    Spain<\/td>\n47 Million<\/td>\nMadrid<\/td>\n<\/tr>\n
    Finland<\/td>\n5.5 Million<\/td>\nHelsinki<\/td>\n<\/tr>\n<\/table><\/pre>\n

    Output:<\/strong>
    \n\"Create<\/p>\n

    Example 4: Table with Caption<\/h4>\n

    Using an HTML table with a caption is a great way to present information on a webpage in a tidy and organized manner. It’s like giving your table a title or a brief description to help people grasp its content easily. To include a caption, all you have to do is use the

    tag and place it right below the tag.<\/p>\n

    Code:<\/strong><\/p>\n