Libraries.Web.Page.WebTable Documentation

The WebTable class represents HTML's (Hypertext Markup Language) table tag which is a class that builds a table. This table contains any number of rows that have been added to the table.

Example Code

use Libraries.Compute.Statistics.DataFrame
use Libraries.Web.Page.TableCaption
use Libraries.Web.Page.WebTable

DataFrame frame
frame:LoadFromCommaSeparatedValue(
"A,B
1,2
3,4
5,6
7,8
9,10"
)
WebTable web
TableCaption caption
caption:AddText("My Table")
web:Add(caption)
web:Add(frame)

text value = Generate()
output value

Inherits from: Libraries.Web.Page.AttributeAccepter, Libraries.Language.Object, Libraries.Web.Page.GlobalAttributeAccepter, Libraries.Web.Page.WebTag

Actions Documentation

Add(Libraries.Compute.Matrix matrix)

This action creates a WebTable object from a two dimensional matrix created with the Matrix class.

Parameters

Example

class Main 
action Main
    Matrix matrix
    matrix:Fill(3, 3, 1.1)

    WebTable table
    table:Add(matrix)
    output table:Generate()
end

Add(Libraries.Compute.Statistics.DataFrame frame)

This action creates a WebTable object from a two dimensional matrix created with the Matrix class.

Parameters

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Web.Page.WebTable

DataFrame frame
frame:LoadFromCommaSeparatedValue(
"A,B
1,2
3,4
5,6
7,8
9,10"
)
WebTable web
web:AddCaption("Yo")
web:Add(frame)
    
text value = web:ToText()
output value

Add(Libraries.Web.Page.Attribute attribute)

This action adds an attribute to this object. If an attribute with the same name as

Parameters

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

Attribute attribute
attribute:SetName("src")
attribute:SetValue("http://www.google.com")

AttributeAccepter accept
accept:Add(attribute)

Add(Libraries.Web.Page.TableRow content)

This action places an TableRow object inside of a WebTable object. There can only be TableRow objects directly in a WebTable if no TableBody is present within the table.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableRow row

        
        page:Add(table)
        table:Add(row)
        text value = page:Generate()
        output value
    end
end

Add(Libraries.Web.Page.TableCaption content)

This action places an TableCaption object inside of a WebTable object.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableCaption caption

        
        page:Add(table)
        caption:AddText("This is a table!")
        table:Add(caption)

        text value = page:Generate()
        output value
    end
end

Add(Libraries.Web.Page.TableFooter content)

This action places an TableFooter object inside of a WebTable object.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableFooter footer

        
        page:Add(table)
        footer:SetDescription("Table 1: A list of things")
        table:Add(footer)
        text value = page:Generate()
        output value
    end
end

Add(Libraries.Web.Page.TableHeader content)

This action places an TableHeader object inside of a WebTable object.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableHeader header

        
        page:Add(table)
        header:SetDescription("My Table")
        table:Add(header)
        text value = page:Generate()
        output value
    end
end

Add(Libraries.Web.Page.ColumnGroup content)

This action places an ColumnGroup object inside of a WebTable object.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        ColumnGroup group
        Column column

        
        page:Add(table)
        group:Add(column)
        table:Add(group)
        text value = page:Generate()
        output value
    end
end

Add(Libraries.Web.Page.TableBody content)

This action places an TableBody object inside of a WebTable object. If a TableBody exists in a WebTable, then TableRows must only be declared within TableBody objects, rather than in the WebTable directly.

Parameters

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableBody tbody
        TableRow row

        
        page:Add(table)
        table:Add(tbody)
        tpage:Add(row)
        text value = page:Generate()
        output value
    end
end

AddAttribute(text name, text value)

This action adds an attribute to this object. This action is a helper action, which essentially does the same thing as the Add(Attribute) action. If an attribute with the same name as

Parameters

  • text name: The name of the attribute functions as a key. For example, in a link, we might have a "src" and an actual address, like google.com. In this case, the name would be equivalent to the src.
  • text value: As an example of link, imagine we have a value of "src" and an actual address, like google.com. In this case, the value would be equivalent to google.com.

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")

AddCaption(text caption)

This action places an TableCaption object inside of a WebTable object.

Parameters

  • text caption

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableCaption caption

        
        page:Add(table)
        caption:AddText("This is a table!")
        table:Add(caption)

        text value = page:Generate()
        output value
    end
end

AddClassAttribute(text value)

Adds to the ClassAttribute attribute. Multiple class names can be listed in the passed text, separated by a space.

Parameters

  • text value: The classes to be added to the element

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
accept:AddClassAttribute("myClass")

AddNestedTag(Libraries.Web.Page.WebTag tag)

This action adds a WebTag to the list of WebTags contained within the current WebTag.

Parameters

Example

use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData


//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)

AddText(text value)

This action sets the description text for this WebTag.

Parameters

  • text value: The text contained in the WebTag.

Example

use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData

//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:AddDescription("name")
row:Add(cell)

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

Generate()

This action places an TableRow object inside of a WebTable object. There can only be TableRow objects directly in a WebTable if no TableBody is present within the table.

Return

text:

Example

use Libraries.Web.Page.all

class Main
    action Main
        WebPage page
        WebTable table
        TableRow row

        
        page:Add(table)
        table:Add(row)
        text value = page:Generate()
        output value
    end
end

GenerateAttributes()

This action returns a text description of all attributes stored.

Return

text:

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
text result = accept:GenerateAttributes()

GenerateNestedTags()

This action generates the HTML output text of all of the nested WebTags.

Return

text: The text including all webtags within this WebTag.

Example

use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData

//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
output row:GenerateNestedTags()

GetAccessKey()

Returns the AccessKey attribute. Specifies a shortcut key for the web element.

Return

Libraries.Web.Page.Attribute: The current AccessKey attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetAccessKey()

GetAttribute(text name)

This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.

Parameters

  • text name

Return

Libraries.Web.Page.Attribute:

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

AttributeAccepter accept
//as we have not set any attribute, this would
//return undefined
Attribute attribute = accept:GetAttribute("src")

GetAttributeValue(text name)

This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.

Parameters

  • text name: The key value in this case is described in more detail in the documentation for this class's Add actions.

Return

text:

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
text value = accept:GetAttributeValue("src")

GetAttributes()

Returns a list of all attributes on the system.

Return

Libraries.Web.Page.Attributes: The attributes class contains all of the attributes that have been set for this object.

Example



use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attributes

AttributeAccepter accept
Attributes attributes = accept:GetAttributes()

GetBorder()

This action gets the border attribute of the web table and returns true if there is a border around the cells and false if it does not.

Return

boolean: True if the cells have a border and false if not.

Example

use Libraries.Web.Page.WebTable
WebTable table
boolean hasBorder = table:GetBorder()

GetClassAttribute()

Returns the ClassAttribute attribute.

Return

Libraries.Web.Page.Attribute: The current ClassAttribute attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetClassAttribute()

GetContentEditable()

Returns the ContentEditable attribute.

Return

Libraries.Web.Page.Attribute: The current ContentEditable attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetContentEditable()

GetContextMenu()

Returns the ContextMenu attribute.

Return

Libraries.Web.Page.Attribute: The current ContextMenu attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetContextMenu()

GetDraggable()

Returns the Draggable attribute.

Return

Libraries.Web.Page.Attribute: The current Draggable attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetDraggable()

GetDropZone()

Returns the DropZone attribute.

Return

Libraries.Web.Page.Attribute: The current DropZone attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetDropZone()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHidden()

Returns the Hidden attribute.

Return

Libraries.Web.Page.Attribute: The current Hidden attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetHidden()

GetIdentifier()

Returns the Identifier attribute.

Return

Libraries.Web.Page.Attribute: The current Identifier attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetIdentifier()

GetIterator()

This action returns an iterator of all attributes stored in this object.

Return

Libraries.Containers.Iterator:

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
use Libraries.Containers.Iterator

AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")

//output out all of the attributes
Iterator<Attribute> it =  accept:GetIterator()
repeat while it:HasNext()
    Attribute at = it:Next()
    output at:Generate()
end

GetLanguage()

Returns the Language attribute.

Return

Libraries.Web.Page.Attribute: The current Language attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetLanguage()

GetNumberOfAttributes()

This action returns the number of attributes that are currently stored in this object.

Return

integer:

Example


use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute

AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
integer num = accept:GetNumberOfAttributes()

GetNumberOfNestedTags()

This action gets the number of nested tags within the current WebTag.

Return

integer: The number of nested tags.

Example

use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData

//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
integer numTags = row:GetSize()

GetSpellcheck()

Returns the Spellcheck attribute.

Return

Libraries.Web.Page.Attribute: The current Spellcheck attribute.

Example



use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute

GlobalAttributeAccepter accept
Attribute attribute = accept:GetSpellcheck()

GetStyle()

Returns the Style attribute.

Return