# Grid

References

  - Foundation 6 Grid;

class crispy_forms_foundation.layout.grid.Row(*fields, **kwargs)

  Bases: `crispy_forms_foundation.layout.base.Div`

  Wrap fields in a div whose default class is `row`. Example:

      Row('form_field_1', 'form_field_2', 'form_field_3')

  Act as a div container row, it will embed its items in a div like that:

      <div class="row">Content</div>

class crispy_forms_foundation.layout.grid.RowFluid(*fields, **kwargs)

  Bases: `crispy_forms_foundation.layout.grid.Row`

  Wrap fields in a div whose default class is “row row-fluid”. Example:

      RowFluid('form_field_1', 'form_field_2', 'form_field_3')

  It has a same behaviour than Row but add a CSS class “row-fluid” that you can use to have top level row that take all the container width. You have to put the CSS for this class to your CSS stylesheets. It will embed its items in a div like that:

      <div class="row row-fluid">Content</div>

  The CSS to add should be something like that:

       /*
       * Fluid row takes the full width but keep normal row and columns
       * behaviors
       */
       @mixin row-fluid-mixin {
           max-width: 100%;
           // Restore the initial behavior restrained to the grid
           .row{
               margin: auto;
               @include grid-row;
               // Preserve nested fluid behavior
               &.row-fluid{
                   max-width: 100%;
               }
           }
       }
       .row.row-fluid{
           @include row-fluid-mixin;
       }
       @media #{$small-up} {
           .row.small-row-fluid{ @include row-fluid-mixin; }
       }
       @media #{$medium-up} {
           .row.medium-row-fluid{ @include row-fluid-mixin; }
       }
       @media #{$large-up} {
           .row.large-row-fluid{ @include row-fluid-mixin; }
       }
       @media #{$xlarge-up} {
           .row.xlarge-row-fluid{ @include row-fluid-mixin; }
       }
       @media #{$xxlarge-up} {
           .row.xxlarge-row-fluid{ @include row-fluid-mixin; }
       }

  It must be included after Foundation grid component is imported.

class crispy_forms_foundation.layout.grid.Column(field, *args, **kwargs)

  Bases: `crispy_forms_foundation.layout.base.Div`

  Wrap fields in a div. If not defined, CSS class will default to `large-12 columns`. `columns` class is always appended, so you don’t need to specify it.

  This is the column from the Foundation Grid component, all columns should be contained in a Row or a RowFluid and you will have to define the column type in the `css_class` attribute.

  Example:

      Column('form_field_1', 'form_field_2', css_class='small-12 large-6')

  Will render to something like that:

      <div class="small-12 large-6 columns">...</div>

  `columns` class is always appended, so you don’t need to specify it.

  If not defined, `css_class` will default to `large-12`.