Column width, jupyter lab

Column width, jupyter lab

BesstrashnyyBesstrashnyy Posts: 2Questions: 1Answers: 0

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

  • kthorngrenkthorngren Posts: 21,629Questions: 26Answers: 5,010

    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

  • BesstrashnyyBesstrashnyy Posts: 2Questions: 1Answers: 0

    Hei @kthorngren,
    Thank for the reply.
    itables is a wrapper for Datatables in Python.

  • allanallan Posts: 63,966Questions: 1Answers: 10,547 Site admin

    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

Sign In or Register to comment.