width

Java JTable cannot set width of column

前提是你 提交于 2019-12-12 18:29:28
问题 I try to set width for the columns, but it didn't work at all, I have been searching for answers for hours, and here is my code, can anyone tell me what is the problem. Thanks in advance. String [] columns = {"Day","StratTime","EndTime","Description"}; mtbl = new DefaultTableModel(); tbl = new JTable(mtbl); jsPane = new JScrollPane(tbl); tbl.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); for (int i = 0; i < Timedcolumns.length; i++) { mtbl.addColumn(columns[i]); tbl.getColumnModel().getColumn(i)

Getting width of div with a parent display: none in Jquery Tab Control

强颜欢笑 提交于 2019-12-12 15:11:59
问题 I have a jquery tab control in which I am building a custom control I've create which needs to know the width of itself during the build process. My problem is when put into a parent container, in this case a tab, which has a 'display: none' I am unable to calculate the width. I've tried it both ways in my control: $('.DataRow').width() $('.DataRow').css('width') both return 0. Is there any other way to get at this width value? 回答1: I have often used this visibility: hidden technique. You can

How to slide toggle a div right to left?

六眼飞鱼酱① 提交于 2019-12-12 15:00:05
问题 Please see this fiddle http://jsfiddle.net/MKwwH/ I want the link images-link to slide toggle right to left? $(document).ready(function() { $('.hidden').hide() }); $('.soundDiv-link').click(function() { $('#soundDiv').slideToggle("slow") }); $('.videoDiv-link').click(function() { $('#videoDiv').next().animate({width: 'toggle'}, "slow") }); $('.imagesDiv-link').click(function() { $('#imagesDiv').animate({width: 'toggle'}, "slow") }); 回答1: The issue is that you have left and right set. Just set

ColumnDefinition MinWidth doesn't work correctly

狂风中的少年 提交于 2019-12-12 14:34:12
问题 I'm using a Grid in WPF (xaml) and I'm have some strange effect when using the MinWidth property in a ColumnDefinition. For example, when I use 9 ColumnDefinition and every ColumnDefinition has the 'Width="*"' property and one of the middle columns also has a MinWidth property then the size of the other columns is wrong. Well, it's hard to discribe but this xaml code illustrates it nicely: <Grid Width="500"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>

How do I get around the IE CSS percentage rounding problem?

纵然是瞬间 提交于 2019-12-12 08:07:27
问题 I'm trying to create a dynamic site where I have three floating boxes next to eachother. They are 33.33% in width each. The container div around them is 75% in width. I've found an article about the problem here: CSS: Jumping columns I've also found an example of the same problem here: Jumping columns example Drag the window size to see the jumping in IE7 or earlier. Anyone knows if it's possible to get around this? (without Javascript) 回答1: I use two different solutions depending on the

How can I Format Width in puttime?

主宰稳场 提交于 2019-12-12 04:31:05
问题 Let's say that I want to print something simple like this table: January 1 February 2 March 3 April 4 May 5 June 6 July 7 August 8 September 9 October 10 November 11 December 12 I'd like to accomplish this like: for(tm i{ 0, 0, 0, 1, 0 }; i.tm_mon < 12; ++i.tm_mon) cout << put_time(&i, "%-9B") << i.tm_mon + 1 << endl; Unfortunately puttime doesn't seem to allow me to use field flags in it's format fields. Additionally this puttime doesn't seem to play nice with setw . Is my only option to do

Table column expand width based on content

只谈情不闲聊 提交于 2019-12-12 04:11:55
问题 There is a table in my page, with 5 columns overall. 3 of these columns have static width, and the rest of them have dynamic width based on their content. I've set max-width to 170px, and min-width to 50px. However, two strange thing happen: 1- in inspect, I can see that min-width (when cell is empty) is 188px, and max-width (when any extra character will cause a break word) is 408px. When span consists of a very small piece of texts, like just a word, it gets a considerable padding from left

add width li's to parent ul

a 夏天 提交于 2019-12-12 04:11:28
问题 i would like to calculate the width of the li's for each submenu en then put in the ul element. example <ul> <li>level 1</li> <li> <ul style="widht:??;"> // total width li's added here 70px <li>level 2</li> // width of this li 20px <li>level 2</li>/ width of this li 50px </ul> </li> <li>level 1</li> <li>level 1 <ul style="widht:??;"> // total width li's added here 70px <li>level 2</li> // width of this li 20px <li>level 2</li>/ width of this li 50px </ul> </li> </ul> i have this so fare if ('

Stretch parent node to its content width

社会主义新天地 提交于 2019-12-12 03:38:40
问题 <div style='width:100%;background-color:green;padding:10px;'> <div style='width: 5000px;background-color:red; padding:5px;'> </div> </div> http://jsfiddle.net/8xqwW/2/ Outer div is fixed at 100% of window, while inner one is rendered at full width. Is there any way to make outer div to stretch to the inner one's width (if it is big) while remaining at at least 100% of the window (if inner div is small)? I cannot use overflow-x:scroll - only window scroll is allowed. Also min-width:100% didn't

Scale a rectangle in html and css

不打扰是莪最后的温柔 提交于 2019-12-12 03:33:41
问题 I want to make a rectangle (a div) with a specific scale. The height-width scale has to be 30:50. The rectangle fills 40% of the width-screen. If I resize my screen, how can I change the height if you keep the scale in mind? HTML: <div id="bg"> </div> CSS: #bg { background-color: blue; width: 40%; } 回答1: Try scaling it using vw (viewport width): #bg { background-color: blue; width: 40vw; height: 66.67vw; } https://jsfiddle.net/gmsitter/9tpbq30x/1/ 来源: https://stackoverflow.com/questions