width

Table width 100% is off by a single pixel (depending on actual width)

若如初见. 提交于 2019-12-05 19:06:50
问题 I have a table in a div inside another div . The direct container has a width of 40% , and I want the table to be as wide as this div, by setting width: 100% . Relevant Markup This works most of the time, however depending on the width of the browser window, the width of the table is sometimes off by a single pixel: As you can see to the right, the border is a pixel to the left of that of the sibling div .info . These borders should align. Relevant CSS #userListContainer{width: 40%; float:

jQuery .width() issues in IE 8

為{幸葍}努か 提交于 2019-12-05 18:16:36
I'm having major issues getting the size of a container in jQuery using width(), outerWidth(), innerWidth() If you load up this URL in IE8 it gives me a width figure of over 30,000 whereas every other browser is around the 1100 mark which is the correct value. This causes problems with the slider as this width value is used to make all sorts of other calculations in regards to the individual slider resizings. I have left the alert in for you to see the width discrepencacies and it is being called on the div with id container. The specific jQuery call is (using no conflict due to other plugins)

Table overflows parent div when td content is too wide

纵然是瞬间 提交于 2019-12-05 17:30:33
问题 I prepared a JSFiddle to explain/show you my problem: http://jsfiddle.net/nz96C/ It looks alright at first, but when I add some text to #firsttd the whole table overflows the parent div once the tds whole width is used. I know how to solve this problem with CSS ( #firstdiv {width:90px;overflow:hidden;} ) but I don't know the exact number of pixels (percentage doesn't work). Also I don't want the text in the first td to wrap. I hope you get my problem, I even have trouble explaining it in my

override bootstrap container width

跟風遠走 提交于 2019-12-05 17:12:39
问题 I have an easy HTML template using bootstrap 3. Template has following structure: static header, static footer and content which is in the bootstrap's class "Container". In the middle of content I have bootstrap'w "Well" and i want it make looks like header and footer. I mean I want it to be the full width of the screen on any screen. I created easy fiddle. Here's a question, is there any way to override container's width inside this container? <header> <div class="container"> <div class=

Calculate width of text node in a block level element using jQuery

懵懂的女人 提交于 2019-12-05 16:47:25
Say I have: <div>Some variable amount of text.</div> How can I get the width (in pixels) of the text in the div? Keep in mind that the amount of text will vary unpredictably from div to div. Thanks! Sounds like you want the width of the contents, not of the div itself as others have provided. I think that you will need to wrap your contents in a span so that you can then measure the width of the span. The div will always be as wide as possible. You need something that collapses to the size of the content that you can measure instead. Samstr The best way I found is to use CSS rule "display

How does css position impact element width/height?

十年热恋 提交于 2019-12-05 15:48:31
How do the various options for css position (static, relative, absolute, fixed) impact the way percentage width/height is calculated? This question may be too generic to provide a concrete answer, and it's possible that the answer is "the two are not directly related", but I'm having trouble understanding the impacts of css position on element size. Links to related questions/answers are welcome. I recommend that you read A List Apart's CSS Positioning article . It's the best article I've seen on the web. 来源: https://stackoverflow.com/questions/8455190/how-does-css-position-impact-element

Proper way to determine UITableViewCell width for grouped custom cells?

拥有回忆 提交于 2019-12-05 15:39:14
I have a custom UITableViewCell created through code (not Interface Builder). I have sub-views that rely on the width of the cell: there is a label that always needs to be just inside the right edge of the cell. The cells appear in a grouped table view. I had originally hard-coded the values to work with iPhone, but now I'm converting the app to a universal binary and the hard-coded numbers are out for grouped table views on the iPad. Is there a proper way to get the width of the cell? The frame returns the full screen width, which is throwing my labels out of place. Or should I just hard-code

jquery: why css('width') returns different value than width()

六眼飞鱼酱① 提交于 2019-12-05 14:31:11
When I run following code: node = $('.period') alert(node.width() + ' ' + node.css('width')) i get '0 144px'. How is that possible? Maybe you're calling it on $(document).ready, and as width() Gets the current computed, pixel, width of the first matched element. , it'd be 0 as it has not been rendered yet... css('width') however reads from the css stylesheet, which would be already available. 来源: https://stackoverflow.com/questions/1212790/jquery-why-csswidth-returns-different-value-than-width

Java Button Width

泄露秘密 提交于 2019-12-05 14:19:54
I've tried to use this and it doesn't work singleplayerButton.setBounds(20, 20, 200, 100); I dont know why though, can anybody help me out with this? My full page code is here package gmine; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class gmine implements ActionListener { JFrame interfaceFrame; JButton singleplayerButton, multiplayerButton, optionsButton, quitButton; public gmine() { JFrame.setDefaultLookAndFeelDecorated(false); interfaceFrame = new JFrame("G-Mine B0.4"); interfaceFrame.setSize(800,600); interfaceFrame.setLayout(new GridLayout(9,1, 20, 15));

Is there a way to adjust the width of UITabBar button items to fit more than 5 buttons on the screen?

吃可爱长大的小学妹 提交于 2019-12-05 13:25:20
My buttons seem stretched, especially in landscape orientation. I can't find a property to adjust either on the UITabBar, UITabBarViewController, or on the UITabBarItem's themselves. (Of course, one answer would be to get an iPad...but that doesn't solve the need for a phone.) For example, consider this simple Tab Bar Example - if I only could set the tab bar to auto-shrink as more buttons are added, or manually adjust the width to fit them all on the tab bar, I would be happy. It is not possible to use the UITabbar with more than five visible buttons. You've got to write your own component.