Python 3

For this option, you will first ask "how
many rows?", and get a positive integer from them. Next, you will ask
"how many columns?", and get another positive integer from them. The next step is to ask for an alignment of
each column. They will enter "L", "C", or "R" for each column. You will then accept rows times columns entries
(don't require them to be any particular type). Finally, print out the items into a table such that:
• each column's items aligned as requested – left, center, or right. Fill blanks with the space character.
• a single space, followed by a tab, is the exact distance between a column's longest element and the next
column. Items in a column that are not longest will need extra spacing to achieve identical spacing
between themselves and the next column.
• Right-aligned columns will be just long enough for the longest item, and then all items' last characters will
then have the space and tab after them.
• The last column should have no extra spacing beyond the longest item – each column should thus be the
exact same width, exactly up to the last character requested by the user (e.g., if they left- or center-align,
then the longest item; if they right-align, then all items' last characters).

To implement this option in Python 3, you can follow these steps:

1. Ask the user for the number of rows using the `input()` function:
```python
num_rows = int(input("How many rows? "))
```

2. Ask the user for the number of columns:
```python
num_cols = int(input("How many columns? "))
```

3. Create a list to store the alignment of each column. The user should enter "L", "C", or "R" for each column:
```python
alignments = []
for i in range(num_cols):
alignment = input("Enter alignment for column {}: ".format(i + 1))
alignments.append(alignment)
```

4. Create a nested list to store the rows of data:
```python
data = []
for _ in range(num_rows):
row = []
for _ in range(num_cols):
item = input("Enter data for the cell: ")
row.append(item)
data.append(row)
```

5. Create a list to store the maximum width of each column:
```python
col_widths = [0] * num_cols
for row in data:
for i, item in enumerate(row):
col_widths[i] = max(col_widths[i], len(item))
```

6. Print the table with the specified alignment:
```python
for row in data:
for i, item in enumerate(row):
if alignments[i] == "L":
print(item.ljust(col_widths[i]) + " " * (col_widths[i] - len(item) + 1), end="\t")
elif alignments[i] == "C":
print(item.center(col_widths[i]) + " " * (col_widths[i] - len(item) + 1), end="\t")
elif alignments[i] == "R":
print(" " * (col_widths[i] - len(item)) + item + "\t", end="")
print()
```

Here's a complete example implementation based on the steps above:

```python
num_rows = int(input("How many rows? "))
num_cols = int(input("How many columns? "))

alignments = []
for i in range(num_cols):
alignment = input("Enter alignment for column {}: ".format(i + 1))
alignments.append(alignment)

data = []
for _ in range(num_rows):
row = []
for _ in range(num_cols):
item = input("Enter data for the cell: ")
row.append(item)
data.append(row)

col_widths = [0] * num_cols
for row in data:
for i, item in enumerate(row):
col_widths[i] = max(col_widths[i], len(item))

for row in data:
for i, item in enumerate(row):
if alignments[i] == "L":
print(item.ljust(col_widths[i]) + " " * (col_widths[i] - len(item) + 1), end="\t")
elif alignments[i] == "C":
print(item.center(col_widths[i]) + " " * (col_widths[i] - len(item) + 1), end="\t")
elif alignments[i] == "R":
print(" " * (col_widths[i] - len(item)) + item + "\t", end="")
print()
```

You can run this code and input the desired values to create a table with the specified alignment.