w3resource

HTML frame attribute

frame

The purpose of the HTML frame attribute is to specify which sides of a table frame should be displayed.

It's better to use CSS border-style properties instead of using frame attribute for table element.

Supported elements

HTML frame attribute supports table element.

Syntax

<table frame="value" >.....</table>

Type of value

Table frame.

Value

Value Description
void Only outside borders are not displayed.
above Only top outside is displayed.
below Only bottom outside border, is displayed.
hsides Only top and bottom outside borders are displayed.
vsides Only left and right outside borders are displayed.
lhs Only left outside border is displayed.
rhs Only right outside border is displayed.
box For all four sides, only outside borders are displayed.
border For all four sides, only outside borders are displayed.

Default value

There is no default value of HTML frame attribute.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.

Example of HTML frame attribute with table

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> Example of HTML frame attribute with table </title>
</head>
<body>
<table frame="border">
         <tr>
           <th>Employee code </th>
           <th>Salary</th>
         </tr>
         <tr>
           <td>EM001</td>
           <td>$1500</td>
         </tr>
<tr>
           <td>EM002</td>
           <td>$1700</td>
         </tr>
</table>
</body>
</html> 

Result

html frame attribute with table

View this example in a separate browser window

Example of HTML frame attribute with table

Previous: HTML for attribute
Next: HTML frameborder attribute