I have a table below in streamlit.
COLUMN1
COLUMN2
aaaaaaaaaaaaaa
b
I wanted to reduce the column width of column1.
This is an open feature request on Streamlit you can see the issue in their github Ability to set dataframe column width #371
A workaround is to use a component for displaying Dataframes called streamlit-aggrid. Column width can be manually configured by dragging the column header on the front end.
Related
I am using a datatable inside a flexdashboard and am having alignment issues when sorting columns. When I sort by certain columns some of the values are longer than others which is causing the columns to resize and making the column headers become misaligned with the values.
I have tried several things such as autoWidth=T, setting the column width to a certain size with width, and centering the values in the columns with className = 'dt-center' but the issue is still persisting.
I have tableView with first column for row number. I would like to set CONSTRAINED_RESIZE_POLICY for all columns without first.
I made:
//First column implementation
column.setPrefWidth(40);
column.setResizable(false);
... //Make other columns
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
So I have first column with width I chose but other are wider than without last line in code above but still there is one additional void column.
And I have another question because I looked for resizing column to length of the longest text in column (I need it for first column) but I only found old answers with very long and tricky solutions. Is there any simple solution (method) to do it?
Edit: I found that when I try to manually resize columns, that they resize properly (as they should with CONSTRAINED) after only click to resize one of columns so I have a question, why they didn't resize from the start like I described above but after trying to manual resize. I think that problem is with setResizable false on first column but how can I repair this?
I found solution. To make other columns CONSTRAINED_RESIZE_POLICY there must be set size of the first column like below:
column.setMinWidth(40);
column.setMaxWidth(40);
and it's working without line setResizable(false).
Manipulating the height like this is one way:
if(data.chats.length<8){
var newRowHeight = processBL.convert_percentage((data.chats.length*10)+5);
$.tableview.height = newRowHeight;
}
However it does not work if you have more than 10 rows. How can I specify how many rows I want on the tableview. Without setting it, I will typically have additional empty rows filling up the height of the table view.
Thanks
My Problem related to Obout Grid is that I have to display more than 250 Column in grid.
& i am getting error
If i display around 100 columns its running well & display all records. Can any one tell what is limit of records that we can display in Grid
Hello I got Solution,
This is a limitation of the standard Unit class:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.unit.pixel.aspx
"The Unit class can represent values only between -32768 and 32767."
So you need to make sure that the sum of all the columns' widths is smaller than 32767.
The default width of a Column is 175px, so if you auto generate the columns you will be able to use up to 187 columns.
If the columns are auto generated, you can reduce the width of the columns using the ColumnsCreated event:
http://www.obout.com/grid/aspnet_events_columns.aspx
If the columns are manually defined using the Columns collection simply set a smaller width for some of them.
reference from blog: http://www.aspbucket.com/2015/11/what-is-maximum-limit-of-display-column.html
I have a QTableWidget that is used to display lots of data, basically derived from a function f(a,b). All a values go into the horizontal header, all b values into the vertical header and all f(a,b) into the corresponding cell.
The columns should be sortable. When a user clicks a column, all values in that column are sorted and all other columns are also "synchronized", since whole rows are sorted (using the clicked column as a sort criterium).
This works. Except for the "header column", the vertical header. The vertical header does not change, it does not synchronize with the reorganized rows. Is this the intended behaviour? Is it a bug in my code? How do I make the vertical header sort, too? Or do I need to add my b's to an ordinary column?
edit: I solved it now by making the header column an ordinary column. Though, I would still be interested in why the vertical header does not sort with the other columns.
Try to use QTableView instead of QTableWidget.
And use QAbstractTableModel for computing f(a,b)