Align Bokeh DataTable column widths - bokeh

I have a bokeh DataTable
As you can see, the columns are all the same width. This results in a fair amount of whitespace and some clipping. Is there a way that I can specify default column widths?

TableColumn (which composes a DataTable) has a width attr that can be set:
http://docs.bokeh.org/en/latest/docs/reference/models/widgets.tables.html#bokeh.models.widgets.tables.TableColumn

Related

DT columns shifting width changing when sorting

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.

adjust the width of table column in streamlit

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.

adjusting row height in phpexcel

I've just been trying unsuccessfully to get phpexcel (PHPExcel_Writer_Excel2007) to automatically adjust row height based on content, when that content contains newline characters. At the moment, only the final line is visible. I've tried setting the row height to -1 for the row in question and the whole column i.e.
$objPHPExcel->getActiveSheet()->getRowDimension(65)->setRowHeight(-1);
and
$objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
but it makes no difference. Help appreciated. Cheers

how to display a set number of rows in a table view (titanium)

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

Sort vertical headers of QTableWidget

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)

Resources