Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style tableLayout Property

Style tableLayout Property

Style Object Reference The Style object


Definition and Usage

The tableLayout property sets or returns the algorithm used to lay out table cells, rows, and columns.

Syntax

Set the tableLayout property:

Object.style.tableLayout="automatic|fixed|inherit"

Return the tableLayout property:

Object.style.tableLayout

Value Description
auto Default. Column widths are set by the content of the cells.
  • This layout can sometimes be slow because it needs to access all the content before the table is fully displayed.
  • | | fixed | Column widths are set by the table width and column widths (not by the cell content). | | inherit | The value of the tableLayout property is inherited from the parent element. |

    Browser support

    Internet ExplorerFirefoxOperaGoogle ChromeSafari

    All major browsers support the tableLayout property.

    **Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


    Example

    Example

    Set a fixed table layout:

    Runoob Tutorial(runoob.com)

        

            

            

        

        

        

                

                

        

        

    table header table header
    This is some text. This is some text. This is some other text

    Try it »


    Style Object Reference The Style object