Tables (Deprecated) attributes in HTML

Posted by:

I will talk with you to day about the (Deprecated) attributes which <table> element can carry.

as we know in HTML the elements can carry attributes which used to say something about the element that carries them, and they always appear on the opening tag of the element that carries them. All attributes are made up of two parts (a name and a value) the syntax will be like

<ElementName AttributeName=”AttributeValue”>

there are many attributes were deprecated in the new versions of HTML, that mean these deprecated attributes will not be in use in the next generations of HTML, we mean here all generations after HTML4, the reason that they are deprecated that we can now use CSS markup properties instead.

let’s have a look on these deprecated attributes and how we can use them in elements.

The <table> element can carry the following deprecated attributes. Even though they are deprecated, you will still see many of them in use today :

align   bgcolor   border   cellpadding   cellspacing   dir   frame   rules   summary   width

The align Attribute :

When used with the <table> element, it indicates whether the table should be aligned to the left (the default), right , or center of the page, It will be like so.

The bgcolor Attribute :

The bgcolor attribute sets the background color for the table. The value of this attribute should either be a color name or a six – digit code known as a hex code, It will be like so.

The border Attribute :

If you use the border attribute, a border will be created around both the table and each individual cell, The value for this attribute is the width you want the outside border of the table to be, in pixels, It will be like so.

The cellpadding Attribute :

The cellpadding attribute is used to create a gap between the edges of a cell and its contents. The value for this attribute determines the amount of space or padding inside each wall of the cell, specified either in pixels, It will be like so.

The cellspacing Attribute :

The cellspacing attribute is used to create a space between the borders of each cell, The value for this attribute can be the amount of space you want to create between the cells, in pixels, It will be like so.

The dir Attribute :

The dir attribute is supposed to indicate the direction of text that is used in the table. Possible values are “ltr” for left to right text and “rtl” for right to left, It will be like so.

The frame Attribute :

The frame attribute is supposed to control the appearance of the outermost border of the whole table, referred to here as its frame , with greater control than the border attribute. If both the frame and border attributes are used, the frame attribute takes precedence, It will be like so.

note : Here we take a fast view on attributes types which is deprecated so we will not discuss the possible values for the frame attribute here .

The rules Attribute :

The rules attribute is used to indicate which inner borders of the table should be displayed, The code will be like so.

also we will not talk here about rules values

The summary Attribute :

The summary attribute is supposed to provide a summary of the table’ s purpose and structure for non visual browsers such as speech browsers or Braille browsers. The value of this attribute is not rendered in IE or Firefox, but if the text before the table doesn’ t clearly explain what will be found in the table, you should aim to use it in your pages, It will be like so.

The width Attribute :

The width attribute is used to specify the width of the table, and usually its value is given in pixels, It will be like so.