HTML frame Attribute

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The frame attribute on a <table> selects which sides of the outer border are drawn. Values include void, above, below, hsides, vsides, lhs, rhs, box, and border.

It is presentational. For new pages, use CSS border-style and border-width (or the border shorthand). Related legacy attributes: border (outer width) and rules (inner lines).

Deprecated.

Do not use frame in new pages. Prefer CSS borders. Browsers still support it for old tables — learn it to read legacy HTML.

Not the <frame> element.

This attribute belongs to <table>. The obsolete <frame> / <frameset> layout model is separate — use <iframe> for embeds.

HTML Syntax

syntax.html
<table frame=" value">

Often paired with border="1" (or similar) so the outer border has a visible width.

Attribute Values

Enumerated sides of the table’s outer frame:

ValueDescriptionTry it
voidNo outer sides (default). Often implied when border="0"Try it
above / belowTop only / bottom onlyTry it
hsides / vsidesTop+bottom / left+rightTry it
lhs / rhsLeft-hand side only / right-hand side onlyTry it
box / borderAll four sides (same idea)Try it

Live Preview

Change frame on a sample table. Prefer CSS borders in real projects.

Legacy demo with border="1". New pages should use CSS border.

Table
Sample scores
NameScore
Ada92
Lin88

frame="box" — all four outer sides

HTML Examples

Legacy snippets for study, plus a CSS replacement. Use Try It Yourself for a live editor.

Example 1 — Full Outer Frame (Legacy)

box (or border) draws all four outer sides.

HTML
<table border="1" frame="box">
  <tr>
    <th scope="col">Item</th>
    <th scope="col">Qty</th>
  </tr>
  <tr>
    <td>Pens</td>
    <td>12</td>
  </tr>
</table>
Try It Yourself

How It Works

  1. border="1" gives the outer frame a 1px width.
  2. frame="box" shows all four sides.
  3. frame="border" means the same as box.
  4. Prefer CSS border: 1px solid on the table today.

Example 2 — Horizontal or Vertical Sides Only

hsides and vsides limit which outer edges appear.

HTML
<table border="1" frame="hsides">
  <tr><th scope="col">Top & bottom only</th></tr>
  <tr><td>Row</td></tr>
</table>

<table border="1" frame="vsides">
  <tr><th scope="col">Left & right only</th></tr>
  <tr><td>Row</td></tr>
</table>
Try It Yourself

How It Works

  1. hsides = horizontal sides (top and bottom).
  2. vsides = vertical sides (left and right).
  3. lhs / rhs draw only one vertical edge.
  4. CSS equivalent: set individual border-*-style / widths.

Example 3 — Modern CSS Replacement

Same “all sides” look without the deprecated attribute.

HTML
<style>
  table.data {
    border: 1px solid #333;
    border-collapse: collapse;
  }
  table.data th,
  table.data td {
    border: 1px solid #999;
    padding: 0.25rem 0.5rem;
  }
</style>

<table class="data">
  <tr>
    <th scope="col">Item</th>
    <th scope="col">Qty</th>
  </tr>
  <tr>
    <td>Pens</td>
    <td>12</td>
  </tr>
</table>
Try It Yourself

How It Works

  1. border on the table replaces frame="box" + border="1".
  2. Cell borders replace legacy rules when you need a grid.
  3. border-collapse keeps lines tidy between cells.
  4. No presentational HTML — styles stay in CSS.

Edge Cases & Pitfalls

Most confusion is naming: table frame vs frameset <frame>.

deprecated

Do not use in new UI

Presentational table attributes are superseded by CSS. Keep them only for legacy maintenance.

vs

Not <frame> / frameborder

frameborder belongs to frames/iframes. Table frame only picks outer border sides.

border

Needs a visible border width

Without border (or CSS), frame may look like it does nothing. border="0" effectively voids the frame.

rules

Inner lines are separate

Use rules (legacy) or CSS cell borders for lines inside the table.

script

IDL: HTMLTableElement.frame

Also deprecated in the DOM API. Prefer CSS classes instead of setting table.frame.

Browser Support

frame is a deprecated HTML attribute on tables in the browser. It is not a Node.js, Deno, or Bun API.

✓ Deprecated · Still widely parsed

frame

Still recognized in major browsers for legacy tables, but marked deprecated. Prefer CSS borders for new work.

97% Legacy recognition (approx.)
Google Chrome Supported (legacy)
Supported
Mozilla Firefox Supported (legacy)
Supported
Apple Safari Supported (legacy)
Supported
Microsoft Edge Supported (legacy)
Supported
Opera Supported (legacy)
Supported
Samsung Internet Modern
Supported
Internet Explorer Yes
Supported
frame Supported · deprecated

Bottom line: Fine for understanding old markup. Do not rely on frame for new designs — use CSS border properties.

Key Takeaways

  • Role: choose which outer sides of a table border are drawn.
  • Element: <table> only (not the obsolete frame tag).
  • Status: deprecated — use CSS border instead.
  • Related: border (width) and rules (inner lines).

One line: table frame picked outer border sides — replace it with CSS borders in new code.

Frequently Asked Questions

On a table, frame selects which sides of the outer border (the frame around the table) are drawn. Values include void, above, below, hsides, vsides, lhs, rhs, box, and border.
Yes. MDN lists it among deprecated table attributes. Prefer CSS border-style and border-width on the table instead.
No. The frame attribute belongs to table. The obsolete frame element lived inside frameset. Use iframe for modern embeds.
frame controls the outer border sides. rules controls internal lines between rows, columns, or groups.
Often yes for a visible effect in legacy markup. border sets the outer border width in pixels; frame chooses which sides show. CSS border is clearer for new pages.
No. Learn it to read old HTML. Style tables with CSS borders instead.

Next: frameborder

Legacy border toggle for frames and iframes (also presentational).

frameborder tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful