width

object width extends Attr

th - This attribute is used to define a recommended cell width.  Additional space can be added with the <a href="/en-US/docs/Web/API/HTMLTableElement/cellSpacing">cellspacing</a> and <a href="/en-US/docs/Web/API/HTMLTableElement/cellPadding">cellpadding</a> properties and the width of the <a title="The HTML <col> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element." href="/en-US/docs/Web/HTML/Element/col"><code><col></code></a> element can also create extra width. But, if a column's width is too narrow to show a particular cell properly, it will be widened when displayed.

<strong>Usage Note: </strong>Do not use this attribute in the latest standard: use the CSS <a title="The width property specifies the width of an element. By default, the property defines the width of the content area. If box-sizing is set to border-box, it instead determines the width of the border area." href="/en-US/docs/Web/CSS/width"><code>width</code></a> property instead. object - The width of the display resource, in <a class="external" href="https://drafts.csswg.org/css-values/#px">CSS pixels</a>.  -- (Absolute values only.  <a class="external" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dimension-attributes">NO percentages</a>) col, colgroup - This attribute specifies a default width for each column in the current column group. In addition to the standard pixel and percentage values, this attribute might take the special form <code>0/</code>, which means that the width of each column in the group should be the minimum width necessary to hold the column's contents. Relative widths such as <code>0.5/</code> also can be used. video - The width of the video's display area, in <a class="external" href="https://drafts.csswg.org/css-values/#px">CSS pixels</a>.  -- (Absolute values only.  <a class="external" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dimension-attributes">NO percentages</a>) td - This attribute is used to define a recommended cell width.  Properties <a href="/en-US/docs/Web/API/HTMLTableElement/cellSpacing">cellspacing</a> and <a href="/en-US/docs/Web/API/HTMLTableElement/cellPadding">cellpadding</a> may add additional space, and element <a title="The HTML <col> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element." href="/en-US/docs/Web/HTML/Element/col"><code><col></code></a> width may also have some effect. In general, if a column's width is too narrow to show a particular cell properly, it, and thus the cells in it, may be widened when displayed.

<strong>Note: </strong>Do not use this attribute in the latest standard: instead set the CSS <a title="The width property specifies the width of an element. By default, the property defines the width of the content area. If box-sizing is set to border-box, it instead determines the width of the border area." href="/en-US/docs/Web/CSS/width"><code>width</code></a> property. iframe - Indicates the width of the frame <span class="inlineIndicator htmlVer htmlVerInline"><a href="/en-US/docs/HTML/HTML5">HTML5</a></span> in CSS pixels, or <span class="inlineIndicator htmlVer htmlVerInline">HTML 4.01</span> in pixels or as a percentage. canvas - The width of the coordinate space in CSS pixels. Defaults to 300. pre - Contains the <em>preferred</em> count of characters that a line should have. Though technically still implemented, this attribute has no visual effect; to achieve such an effect, use CSS <a title="The width property specifies the width of an element. By default, the property defines the width of the content area. If box-sizing is set to border-box, it instead determines the width of the border area." href="/en-US/docs/Web/CSS/width"><code>width</code></a> instead. hr - Sets the length of the rule on the page through a pixel or percentage value. img - The intrinsic width of the image in pixels. In <span class="inlineIndicator htmlVer htmlVerInline"><a href="/en-US/docs/HTML">HTML 4</a></span>, either a percentage or pixels were acceptable values. In <span class="inlineIndicator htmlVer htmlVerInline"><a href="/en-US/docs/HTML/HTML5">HTML5</a></span>, however, only pixels are acceptable. table - This attribute defines the width of the table. The width may be defined by pixels or a percentage value. A percentage value will be defined by the width of the container in which the table is placed.

<strong>Usage Note: </strong>Do not use this attribute, as it has been deprecated. The rules should be defined and styled using <a href="/en-US/docs/CSS">CSS</a>. Use the <a title="The width property specifies the width of an element. By default, the property defines the width of the content area. If box-sizing is set to border-box, it instead determines the width of the border area." href="/en-US/docs/Web/CSS/width"><code>width</code></a> property instead. embed - The displayed width of the resource, in <a class="external" href="https://drafts.csswg.org/css-values/#px">CSS pixels</a>.  -- (Absolute values only.  <a class="external" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dimension-attributes">NO percentages</a>) input - If the value of the <strong>type</strong> attribute is <code>image</code>, this attribute defines the width of the image displayed for the button.

trait Attr
class Object
trait Matchable
class Any

Type members

Classlikes

object tag extends TagElement

Types

Inherited types

type supports[T <: Tag] = AttrPair[attrType] => AttrPair[tagType]
Inherited from
Attr

Value members

Concrete methods

@inline
def :=(v: String): AttrPair[_width_attr]
@inline
def :=(v: Option[String]): OptionalAttrPair[_width_attr]