public function calcLength(array $data)
    {
        $lengths = array();

        foreach ($data as $table) {
            foreach ($table as $key => $value) {
                $len = strlen($value);

                if (!isset($lengths[$key]) || $len > $lengths[$key]) {
                    $lengths[$key] = $len;
                }

                if (isset($lengths[$key]) && strlen($key) > $lengths[$key]) {
                    $lengths[$key] = strlen($key);
                }
            }
        }

        return $lengths;
    }