---
title: HTMLTableElement.width
slug: Web/API/HTMLTableElement/width
tags:
  - API
  - HTML DOM
  - HTMLTableElement
  - NeedsBrowserCompatibility
  - NeedsSpecTable
  - Property
  - Reference
  - Deprecated
browser-compat: api.HTMLTableElement.width
---
{{APIRef("HTML DOM")}} {{Deprecated_Header}}

The **`HTMLTableElement.width`** property represents the
desired width of the table.

## Syntax

```js
HTMLTableElement.width = width;
var width = HTMLTableElement.width;
```

Where `width` is a string representing the width in number of pixels or as a
percentage value.

## Example

```js
mytable.width = "75%";
```

## Browser compatibility

{{Compat}}

## Specifications

- W3C DOM 2 HTML Specification [_HTMLTableElement_
  .width](https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-77447361)
