codecov[bot]: # [Codecov](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=h1) Report
> Merging [#64](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=desc) into [master](https://codecov.io/gh/pri22296/beautifultable/commit/c9638f73dff4bb1f341c9ee783e4e47f26efba0b?src=pr&el=desc) will **decrease** coverage by `0.45%`.
> The diff coverage is `25%`.

[![Impacted file tree graph](https://codecov.io/gh/pri22296/beautifultable/pull/64/graphs/tree.svg?width=650&token=JGEoYMIaay&height=150&src=pr)](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   80.24%   79.79%   -0.46%     
==========================================
  Files          12       12              
  Lines         967      975       +8     
  Branches      144      148       +4     
==========================================
+ Hits          776      778       +2     
- Misses        142      145       +3     
- Partials       49       52       +3
```


| [Impacted Files](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [beautifultable/beautifultable.py](https://codecov.io/gh/pri22296/beautifultable/pull/64/diff?src=pr&el=tree#diff-YmVhdXRpZnVsdGFibGUvYmVhdXRpZnVsdGFibGUucHk=) | `73.4% <25%> (-0.87%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=footer). Last update [c9638f7...ec0ea71](https://codecov.io/gh/pri22296/beautifultable/pull/64?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

diff --git a/.gitignore b/.gitignore
index 4527dcd..e70f354 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ dist/
 build/
 .tox/
 *.pyc
+.coverage
diff --git a/README.rst b/README.rst
index 16aadd1..c26bea2 100644
--- a/README.rst
+++ b/README.rst
@@ -133,6 +133,8 @@ Unreleased
 
 * Dropped support for Python 3.3
 * Added support for streaming tables using a generator for cases  where data retrieval is slow
+* Alignment, padding, width can now be set for all columns using a simplified syntax like
+  ``table.column_alignments = beautifultable.ALIGN_LEFT``
 
 ==========
 v0.7.0
diff --git a/beautifultable/beautifultable.py b/beautifultable/beautifultable.py
index ae4041f..3f54c51 100644
--- a/beautifultable/beautifultable.py
+++ b/beautifultable/beautifultable.py
@@ -332,6 +332,8 @@ class BeautifulTable(object):
 
     @column_widths.setter
     def column_widths(self, value):
+        if isinstance(value, int):
+            value = [value] * self._column_count
         width = self._validate_row(value)
         self._column_widths = PositiveIntegerMetaData(self, width)
 
@@ -366,6 +368,8 @@ class BeautifulTable(object):
 
     @column_alignments.setter
     def column_alignments(self, value):
+        if isinstance(value, enums.Alignment):
+            value = [value] * self._column_count
         alignment = self._validate_row(value)
         self._column_alignments = AlignmentMetaData(self, alignment)
 
@@ -380,6 +384,8 @@ class BeautifulTable(object):
 
     @left_padding_widths.setter
     def left_padding_widths(self, value):
+        if isinstance(value, int):
+            value = [value] * self._column_count
         pad_width = self._validate_row(value)
         self._left_padding_widths = PositiveIntegerMetaData(self, pad_width)
 
@@ -394,6 +400,8 @@ class BeautifulTable(object):
 
     @right_padding_widths.setter
     def right_padding_widths(self, value):
+        if isinstance(value, int):
+            value = [value] * self._column_count
         pad_width = self._validate_row(value)
         self._right_padding_widths = PositiveIntegerMetaData(self, pad_width)
 

Allow setting alignment, etc for all columns more easily
The following syntax could be used to align all columns with a simple statement.

```
table.column_alignments = beautifultable.ALIGN_LEFT
```
diff --git a/test.py b/test.py
index c0fa342..8deb0a5 100644
--- a/test.py
+++ b/test.py
@@ -245,6 +245,23 @@ class TableOperationsTestCase(unittest.TestCase):
 | Sophia   |  2   |   girl |
 +----------+------+--------+
 | Michael  |  3   |    boy |
++----------+------+--------+"""
+        self.assertEqual(string, self.table.get_string())
+
+    def test_align_all(self):
+        self.table.column_alignments = self.table.ALIGN_LEFT
+        string = """+----------+------+--------+
+| name     | rank | gender |
++----------+------+--------+
+| Jacob    | 1    | boy    |
++----------+------+--------+
+| Isabella | 1    | girl   |
++----------+------+--------+
+| Ethan    | 2    | boy    |
++----------+------+--------+
+| Sophia   | 2    | girl   |
++----------+------+--------+
+| Michael  | 3    | boy    |
 +----------+------+--------+"""
         self.assertEqual(string, self.table.get_string())
 

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
-e git+https://github.com/pri22296/beautifultable.git@d5a4c55cff51809bf020ed1cc56c377b48e30ff3#egg=beautifultable
certifi==2021.5.30
importlib-metadata==4.8.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: beautifultable
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/beautifultable

test.py::TableOperationsTestCase::test_align_all
test.py::TableOperationsTestCase::test_ansi_ellipsis_mb test.py::TableOperationsTestCase::test_ansi_strip_mb test.py::TableOperationsTestCase::test_ansi_wrap_mb test.py::TableOperationsTestCase::test_eastasian_characters
test.py::TableOperationsTestCase::test_access_column_by_header test.py::TableOperationsTestCase::test_access_row_by_index test.py::TableOperationsTestCase::test_access_row_element_by_header test.py::TableOperationsTestCase::test_access_row_element_by_index test.py::TableOperationsTestCase::test_ansi_ellipsis test.py::TableOperationsTestCase::test_ansi_sequences test.py::TableOperationsTestCase::test_ansi_strip test.py::TableOperationsTestCase::test_ansi_wrap test.py::TableOperationsTestCase::test_append_column test.py::TableOperationsTestCase::test_append_row test.py::TableOperationsTestCase::test_column_count test.py::TableOperationsTestCase::test_contains test.py::TableOperationsTestCase::test_delitem_int test.py::TableOperationsTestCase::test_delitem_slice test.py::TableOperationsTestCase::test_delitem_str test.py::TableOperationsTestCase::test_empty_header test.py::TableOperationsTestCase::test_empty_table_by_column test.py::TableOperationsTestCase::test_empty_table_by_row test.py::TableOperationsTestCase::test_get_column_header test.py::TableOperationsTestCase::test_get_column_index test.py::TableOperationsTestCase::test_get_string test.py::TableOperationsTestCase::test_getitem_slice test.py::TableOperationsTestCase::test_insert_column test.py::TableOperationsTestCase::test_insert_row test.py::TableOperationsTestCase::test_left_align test.py::TableOperationsTestCase::test_mixed_align test.py::TableOperationsTestCase::test_newline test.py::TableOperationsTestCase::test_newline_multiple_columns test.py::TableOperationsTestCase::test_pop_column_by_header test.py::TableOperationsTestCase::test_pop_column_by_position test.py::TableOperationsTestCase::test_pop_row test.py::TableOperationsTestCase::test_right_align test.py::TableOperationsTestCase::test_row_count test.py::TableOperationsTestCase::test_serialno test.py::TableOperationsTestCase::test_setitem_int test.py::TableOperationsTestCase::test_setitem_slice test.py::TableOperationsTestCase::test_setitem_str test.py::TableOperationsTestCase::test_signmode_plus test.py::TableOperationsTestCase::test_table_auto_width test.py::TableOperationsTestCase::test_table_width_zero test.py::TableOperationsTestCase::test_update_column test.py::TableOperationsTestCase::test_update_row test.py::TableOperationsTestCase::test_update_row_slice test.py::TableOperationsTestCase::test_wep_ellipsis test.py::TableOperationsTestCase::test_wep_strip test.py::TableOperationsTestCase::test_wep_wrap
README.rst .gitignore beautifultable/beautifultable.py
README.rst .gitignore beautifultable/beautifultable.py