Cannot change the width of Table column
See original GitHub issueHi,
I am trying to change the width of column and also the formatter of column. But it seems not to work as expected. Here is my code!
import holoviews as hv
from bokeh.models import HTMLTemplateFormatter
hv.extension('bokeh')
def apply_format(plot, element):
plot.handles['table'].columns[0].width = 100
plot.handles['table'].columns[0].formatter=HTMLTemplateFormatter(template='<a href="<%= value %>"><%= value %></a>')
gender = ['M','M', 'M','F']
age = [10,16,13,12]
weight = [15,18,16,10]
height = [0.8,0.6,0.7,0.8]
profile=['http://a.com', 'httmp://b.com', 'http://c.com', 'http://d.com']
table = hv.Table({'Gender':gender, 'Age':age, 'Weight':weight, 'Height':height, 'Profile': profile},
['Profile', 'Gender', 'Age'], ['Weight', 'Height'])
table.groupby('Gender').opts(height=140, width=700, hooks=[apply_format])
Anyone has the same issue or know how to do this properly?
Thanks, Tran
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Can't adjust table column width - Microsoft Community Hub
Set the column widths as you want them to be -- either by dragging the column borders or the markers on the ribbon ......
Read more >Can't change table cell width - Stack Overflow
This table should be divided into 1x3 cells, each containing a select combo box. Now the inner table always takes too big width...
Read more >Column width won't adjust - Google Groups
Column width won't adjust · 1. Click "layout" besides "Table Design" · 2. Click "Cell Margins" · 3. the "Table Options" window will...
Read more >How to fix the width of columns in the table ? - GeeksforGeeks
The width of the columns i.e. td in a table can be fixed very easily. This can be done by adding the width...
Read more >Precisely Adjusting Table Column Widths - Word Ribbon Tips
Select the column whose width you want to change. · Display the Layout tab of the ribbon. · Click the Properties option in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I noticed that column width resizing did not work until i changed the default
autosize_mode
@xtutran no problem. Do you still use the hv.Table somewhere. In case it helped you could close this issue then.