DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Html

HTML Tables

Share

In html there are set of elements that are needed to create tables. Table can be created using <table> element.
Each row of a tables are defines via <tr> element and each cell are defines via <td> element within <tr> element.

So a basic structure of a table looks like:

<table>
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
</table>

You can set the border using border attribute i.e. border=”1″. Also you can set spacing using cellspacing and cellpadding attribute as below:

<table border="1" cellspacing="5" cellpadding="5">
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
</table>

Table thead, tfoot and tbody:
A tables can be defined using table head i.e. <thead> and table foot i.e. <tfoot>. It is useful when printing a page as header and footer shows on each page automatically. Remember that <thead> use <th> element incase of <td>.

<table>
    <thead>
    <tr>
        <th>Title 1</th>
        <th>Title 2</th>
    </tr>
    </thead>
    <tfoot>
    <tr>
        <td>Footer cell 1</td>
        <td>Footer cell 2</td>
    </tr>
    </tfoot>
    <tbody>
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
    <tr>
        <td>Cell</td>
        <td>Cell</td>
    </tr>
    </tbody>
</table>

You can also set horizontal and vertical alignment using “valign” and “align” attribute.

Namaste UI (Author)

Namaste UI collaborates closely with clients to develop tailored guest posting strategies that align with their unique goals and target audiences. Their commitment to delivering high-quality, niche-specific content ensures that each guest post not only meets but exceeds the expectations of both clients and the hosting platforms. Connect with us on social media for the latest updates on guest posting trends, outreach strategies, and digital marketing tips. For any types of guest posting services, contact us on info[at]namasteui.com.

Published by
Namaste UI (Author)

Recent Posts

How to tell whether high-level glass is toughened or laminated

Glass at height is easy to overlook, in both senses. It is out of reach,…

6 days ago

Signs Your Rental Business Has Outgrown Spreadsheets (and What to Do Next)

Almost every rental business starts the same way. A handful of items, a notebook or…

6 days ago

Why You Should Demand a Team Of Office Interior Design

When it comes to designing the office interior you need a highly professional designer. Your…

1 week ago

Understanding the Basics of First Aid and Emergency Response in Canberra

Emergencies can happen anywhere, whether at home, in the workplace, at school, or during outdoor…

2 weeks ago

How Guest Posts for Dental Practices Build Trust and Digital Reach

A dental practice’s website is essential, but it is only one place where prospective patients…

3 weeks ago

Small Personal Touches That Make a Golf Day More Enjoyable

Golf is often described as a game of patience, practice, and precision. That is true,…

3 weeks ago