Previous Next blank.gif Home Page

Class Multicol - Declare a multi-column section of the page.


SYNOPSIS

import HTMLgen
class Multicol(Container)
  int cols = 2
  def end_tag(self)
  int gutter = 0
  def set_total_width(self, total)
  def start_tag(self)
  def total_width(self)
  int gutter = 0

  # Methods inherited by Multicol from Container
  def __add__(self, other)
  def __init__(self, *args, **kw)
  def __repr__(self)
  def append(self, *items)
  def copy(self)
  def empty(self)
  def last(self)
  def length(self)
  def prepend(self, *items)

alias MULTICOL = Multicol

DESCRIPTION

Instantiate the Multicol class and use the append method to add contents to the section. Mutlicol sections can be nested but it's not recommended for appearance reasons.

def __add__(self, other)

Support self + list

def append(self, *items)

Append one or more items to the end of the container.

def copy(self)

Return a full copy of the object.

def empty(self)

Empty the contents of the container.

def end_tag(self)

Return end tag for this tag type

def last(self)

Return the last item in the container.

def length(self)

Return the integer length of the container list.

def prepend(self, *items)

Prepend one or more items to the top of the container.

def set_total_width(self, total)

Calculates and sets the column width needed to make this section the given the total width in pixels desired.

def start_tag(self)

Return start tag for this tag type including all attributes

def total_width(self)

Calculates the total width in pixels of the multi-column section given the current object properties.

Keyword Arguments

cols
number of column. If not provided it defaults to 2.
gutter
width in pixels of the gap between the columns. Default is 10.
width
width in pixels of the columns. All columns are the same width. Overall width of the multicol section is (cols * width) + ((cols - 1) * gutter)

The method total_width is provided for the lazy folks who don't want to calculate the above equation.

SEE ALSO

HTMLgen

Container


Previous Next blank.gif Home Page
Buzz.gif

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedric@phoenix.net
Generated: Mon Dec 2 1996