Arteqo Consulting

The European Web Agency

Design, brand and digital development


×

Arteqo Consulting Services

Contact Arteqo

×
I have read and accept the terms and conditions

table tag

The table tag, which, when implemented in the code, is written like this - <table>, is an HTML tag that belongs to table tags. Table HTML tags are used to create tables, as well as to define some non-CSS formatting options.

<table> defines an HTML table. An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements. The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell. A more complex HTML table may also include <caption>, <col>, <colgroup>, <thead>, <tfoot>, and <tbody> elements. This tag is supported in the current version of HTML, which is HTML5.

Browser support

Here you can see whether <table> is supported by a certain browser, and, if yes, starting from which version it is supported.

Browser support for <table>
ChromeFirefoxEdgeOperaSafari
Is supportedIs supportedIs supportedIs supportedIs supported

Attributes and values

An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.

Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.

What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.

The <table> tag supports the following attributes (with their respective values):

AttributeValueDescription
align
  • left
  • center
  • right
Specifies the alignment of a table according to surrounding text
(Not Supported in HTML5)
bgcolor
  • rgb(x,x,x)
  • #xxxxxx
  • colorname
Specifies the background color for a table
(Not Supported in HTML5)
border
  • 1
  • 0
Specifies whether or not the table is being used for layout purposes
(Not Supported in HTML5)
cellpaddingpixelsSpecifies the space between the cell wall and the cell content
(Not Supported in HTML5)
cellspacingpixelsSpecifies the space between cells
(Not Supported in HTML5)
frame
  • void
  • above
  • below
  • hsides
  • lhs
  • rhs
  • vsides
  • box
  • border
Specifies which parts of the outside borders that should be visible
(Not Supported in HTML5)
rules
  • none
  • groups
  • rows
  • cols
  • all
Specifies which parts of the inside borders that should be visible
(Not Supported in HTML5)
sortablesortableSpecifies that the table should be sortable
summarytextSpecifies a summary of the content of a table
(Not Supported in HTML5)
  • pixels
  • %
  • pixels
  • %
Specifies the width of a table
(Not Supported in HTML5)

Global Attributes

Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.

<table> supports global attributes.

Event Attributes

Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.

<table> supports event attributes.