Column width, jupyter lab
Column width, jupyter lab
![Besstrashnyy](https://secure.gravatar.com/avatar/d5f541f05e322b447b8b0849295af5cb/?default=https%3A%2F%2Fvanillicon.com%2Fd5f541f05e322b447b8b0849295af5cb_200.png&rating=g&size=120)
Hey guys,
I'm trying to adjust the width of the table columns in Jupyter lab.
My goal, is to adjust the width based on the content, but if this is not possible, i'm fine with doing it manually.
Tried different approaches, but nothing seems to work.
Here's the code, and libraries which I have imported.
Any ideas?
import pandas as pd
import os
import re
import numpy as np
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', 100)
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from IPython.display import display, HTML
from itables import init_notebook_mode, show
from itables import options as opt
from pathlib import Path
from collections import Counter
init_notebook_mode(all_interactive=True)
opt.column_filters = "header"
display(HTML('<style>.container{width:100% !important}</style>'))
pd.set_option('display.max_columns', None)
pd.options.display.float_format = '{:.3f}'.format # number of decimals in float columns
opt.maxBytes=10000000 # the limit for data in itables
Answers
It doesn't look like you are using Datatables. This forum is for Datatables related questions. Possibly the Jupyter Lab forum or Stack Overflow to search and/or ask your questions about Jupyter Labs.
Kevin
Hei @kthorngren,
Thank for the reply.
itables is a wrapper for Datatables in Python.
You can use
columns.width
in DataTables to tell DataTables what you want the width of a column to be. Note that it can override you if it is needed to make the table fit into the space.Exactly how that option is set, I'm not entirely sure! You'd need to ask Mark (the author of ITables) or check its documentation.
Allan