### Home Classes Methods

### In Files

- lib/prawn/layout/grid.rb

### Parent

Object

### Methods

- #column_width
- #row_height
- #show_all

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Configurable
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::GridBox
- Prawn::Document::Internals
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::FontMetricCache
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Patterns
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::ImageHandler
- Prawn::Images
- Prawn::Images::Image
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::SoftMask
- Prawn::Stamp
- Prawn::SynchronizedCache
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::Image
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::SpanDummy
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Table::ColumnWidthCalculator
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Prawn::ThreadLocalCache
- PDF
- PDF::Core
- PDF::Core::Reference
- PDF::Core::Stream
- Arcfour
- Numeric

No matching classes.

# Prawn::Document::Grid

A Grid represents the entire grid system of a Page and calculates the column width and row height of the base box.

@private

### Attributes

column_gutter[R]
columns[R]
gutter[R]
pdf[R]
row_gutter[R]
rows[R]

### Public Instance Methods

column_width() click to toggle source

Calculates the base width of boxes.

    # File lib/prawn/layout/grid.rb, line 58
    def column_width
      @column_width ||= subdivide(pdf.bounds.width, columns, column_gutter)
    end

row_height() click to toggle source

Calculates the base height of boxes.

    # File lib/prawn/layout/grid.rb, line 63
    def row_height
     @row_height ||= subdivide(pdf.bounds.height, rows, row_gutter)
    end

show_all(color = "CCCCCC") click to toggle source

Diagnostic tool to show all of the grids. Defaults to gray.

    # File lib/prawn/layout/grid.rb, line 68
    def show_all(color = "CCCCCC")
      self.rows.times do |i|
        self.columns.times do |j|
          pdf.grid(i,j).show(color)
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.