Sets table cell

@param int $spacing
@param int $padding

@return Table
488141
public function cell(Int $spacing, Int $padding) : Table
    {
        $this->attr['cellspacing'] = $spacing;
        $this->attr['cellpadding'] = $padding;

        return $this;
    }
1341146
public function setIndent($spacesNum)
    {
        if ($spacesNum) {
            $this->writer->setIndent(true);
            $this->writer->setIndentString(str_repeat(' ', (int)$spacesNum));
        } else {
            $this->writer->setIndent(false);
        }
        return $this;
    }
140327
public AsciiTable setPaddingLeft(int paddingLeft) {
		for(AT_Row row : this.rows){
			if(row.getType()==TableRowType.CONTENT){
				row.setPaddingLeft(paddingLeft);
			}
		}
		return this;
	}
590110
public static function add($spacing = 0, $iscustom = false)
    {
        if (!$spacing) {
            $spacing = 0; // just in case
        }
        if (!$iscustom) {
            $iscustom = 0;
        } else {
            $iscustom = 1;
        }

        $db = Loader::db();
        $db->Execute('insert into AreaLayouts (arLayoutSpacing, arLayoutIsCustom, arLayoutUsesThemeGridFramework) values (?, ?, ?)', array($spacing, $iscustom, 0));
        $arLayoutID = $db->Insert_ID();
        if ($arLayoutID) {
            $ar = static::getByID($arLayoutID);

            return $ar;
        }
    }
15375
public AT_Row setPaddingLeftRight(int padding){
		if(this.hasCells()){
			for(AT_Cell cell : this.getCells()){
				cell.getContext().setPaddingLeftRight(padding);
			}
		}
		return this;
	}
176651
public function setTable($table)
    {
        $this->table = $table;

        //for each row
        foreach ($this->data as $row) {
            if (!is_object($row) || !method_exists($row, __FUNCTION__)) {
                continue;
            }

            //let the row handle this
            $row->setTable($table);
        }

        return $this;
    }
1087628
public function setPadding($padding = 0) {
		$padding = $this->parseSizes($padding);

		foreach ($padding as $side => $value) {
			if (! is_int($value) || $value < 0) {
				throw new InvalidArgumentException(sprintf(
					'Invalid %s padding: "%s". Must be a positive integer value.',
					$side, $value
				));
			}

			$this->padding[$side] = $value;
		}
	}
1066685
public function setTable($table, $pagination)
    {
        $this->where = null;
        $this->limit = null;
        $this->order = null;
        $this->duplicateUpdate = null;
        $this->query = null;
        $this->pagination = $pagination;
        $this->table = $table;

        return $this;
    }
215883
public AsciiTable setPaddingLeftRight(int padding){
		for(AT_Row row : this.rows){
			if(row.getType()==TableRowType.CONTENT){
				row.setPaddingLeftRight(padding);
			}
		}
		return this;
	}
566569
public AT_CellContext setPadding(int padding){
		if(padding>-1){
			this.paddingTop = padding;
			this.paddingBottom = padding;
			this.paddingLeft = padding;
			this.paddingRight = padding;
		}
		return this;
	}
145154
public Cell<C,T> pad (float pad) {
		Value<C,T> value = new FixedValue<C, T>(layout.toolkit,pad);
		padTop = value;
		padLeft = value;
		padBottom = value;
		padRight = value;
		return this;
	}
108438
public function setRows($rows)
    {
        $this->rows = $rows;
        $this->rowsString = sprintf('`%s`', implode('`,`', $this->rows));

        return $this;
    }
258564
public function setRow(TableRow $row = null)
    {
        $this->row = $row;

        if (null !== $row && !in_array($this, $row->getCells())) {
            $row->addCell($this);
        }

        return $this;
    }
836311
public function setRows($rows = [])
    {
        if (Arr::isAssoc($rows)) {
            foreach ($rows as $key => $item) {
                $this->rows[] = [$key, $item];
            }

            return $this;
        }

        $this->rows = $rows;

        return $this;
    }
1039807
public Table applyPadding (final Table table) {
		table.pad(top, left, bottom, right);
		return table;
	}
672724
public function addTable($rows, $headers = false)
	{
		// Figure out some items we need to know
		$maxLengths = [];

		foreach ($rows as $i => $row)
		{
			foreach ($row as $k => $field)
			{
				$maxLengths[$k] = isset($maxLengths[$k]) ? $maxLengths[$k] : 0;
				$maxLengths[$k] = strlen($field) > $maxLengths[$k] ? strlen($field) : $maxLengths[$k];
			}
		}

		// Compute the total length of the table
		$width = array_sum($maxLengths) + ((count($row) - 1) * 3) + 2;

		// Add the top border
		$this->addLine('/' . str_repeat('-', ($width)) . '\\');

		// Draw the rows
		foreach ($rows as $i => $row)
		{
			$styles = ($i == 0 && $headers) ? ['format' => 'underline'] : null;
			foreach ($row as $k => $field)
			{
				$padding = $maxLengths[$k] - strlen($field);
				$this->addString('| ');
				$this->addString($field, $styles);
				$this->addString(' ' . str_repeat(' ', $padding));
			}

			$this->addLine('|');
		}

		// Add the bottom border
		$this->addLine('\\' . str_repeat('-', ($width)) . '/');
	}
156977
public function fitText($width, $text = '', $padding = 0)
    {
        $spaces = $width - strlen($text) - $padding;

        return $text . str_repeat(' ', $spaces < 0 ? 0 : $spaces);
    }