msGridColumns property

Gets or sets one or more values that specify the width of each grid column within the object.

This property is read/write.

 

Syntax

HRESULT put_msGridColumns(
  [in]          BSTR v
);

HRESULT get_msGridColumns(
  [out, retval] BSTR *p
);

Property values

Type: BSTR

One or more column widths, separated by spaces.

String format

[ auto |width| min-content | max-content | minmax(min, max) ] + | none

CSS information

Applies To non-replaced block elements
Media visual paged
Inherited no
Initial Value auto

Standards information

Remarks

This property also supports a repeating syntax. If there are a large number of columns that are the same or exhibit a recurring pattern, a repeat syntax can be applied to define the columns in a more compact form. The repeated values are enclosed by parentheses, and are followed by an integer within brackets (for instance, [4]) that indicates how many times to repeat the values in parentheses. See Examples for a demonstration.

When space is allocated to a column, priority is given to those columns that have their width specified as a length or as a percentage. Any remaining space is then allocated to those columns that have their width specified as a proportion.

Each distance value defines a column that can be referred to by a number that corresponds to its position in the list. The first distance value specified defines a column 1, the second 2, and so on.

Child elements are clipped if they are too large to fit in the allocated space.

Examples

The following two examples illustrate the repeating IHTMLCSSStyleDeclaration2::msGridColumns syntax. They are equivalent. There is a single row, and a pattern of four repeated columns: a 250px column followed by a 10px gutter.

<style type="text/css">
  #grid {
    display: -ms-grid;
    -ms-grid-columns: 10px 250px 10px 250px 10px 250px 10px 250px 10px;
    -ms-grid-rows: 1fr;
  } 

  /* Equivalent definition. */
  #grid {
    display: -ms-grid;
    -ms-grid-columns: 10px (250px 10px)[4];
    -ms-grid-rows: 1fr;
  }
</style>

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IHTMLCSSStyleDeclaration2::msGridColumn