Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
    • Angular
    • C
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
  • Register
  • Login
  1. Home
  2. Blogpost

Attribute of table in HTML

Date- Dec 09,2023

3012

In HTML, the <table> tag is used to create tables to display data in a structured grid format. The <table> tag can contain several attributes that help in defining and customizing the behavior and appearance of the table. Here are some commonly used attributes of the <table> tag:

  1. 1. border:

    • The border attribute is used to set the border width around the table and its cells.
    • Example: <table border="1">
  2. 2. cellpadding:

    • The gap between the cell content and the cell border is specified by the cellpadding attribute.
    • Example: <table cellpadding="5">
  3. 3. cellspacing:

    • The cellspacing attribute specifies the space between table cells.
    • Example: <table cellspacing="5">
  4. 4. width:

    • The width attribute specifies the table's width.
    • Example: <table width="100%">
  5. 5. height:

    • The height attribute sets the height of the table.
    • Example: <table height="200">
  6. 6. align:

    • The align attribute aligns the table with respect to the surrounding content (left, center, right).
    • Example: <table align="center">
  7. 7. summary:

    • The summary attribute provides a brief description of the table's content for accessibility purposes.
    • Example: <table summary="Monthly sales data">
  8. 8. bordercolor:

    • The bordercolor attribute sets the color of the table border.
    • Example: <table bordercolor="#CCCCCC">
  9. 9. bgcolor:

    • The bgcolor attribute sets the background color of the table.
    • Example: <table bgcolor="#F5F5F5">

Please note that while these attributes can be used for basic formatting, it's generally recommended to use CSS (Cascading Style Sheets) for styling HTML elements, including tables. CSS provides more control and flexibility for formatting and styling tables, and it separates the design from the content, making it easier to maintain and customize the appearance of the table.




S
Shubham Saini
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Comments

Tags

AspNet
C#
programming
AspNet MVC
c programming
AspNet Core
C
software development
tutorial
MVC
memory management
Paypal
coding
coding best practices
data structures
programming tutorial
tutorials
object oriented programming
Slick Slider
StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
By Language
  • Angular
  • C
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page