width

Fail on setting attribute for canvas from Javascript

Hi all, I have to set the attributes 'width' and 'height' for a canvas element, depending on the available screen resolution. Setting them statically from html works (ex. <canvas id="canv" width="1600" ... ). From Javascript I can't do it. I've googled and searched in SO but I didn't find anything that works. I am using JQuery and I've t...

CSS make textbox fill all available width

I have the following "line" in my web page <div style="width:100%"> "Some Text" <DropDown> "Some more text" <TextBox> <Button> <Button> </div> The DropDown control I don't really have control over the width, as it sizes to fit whatever the longest option value is. The Buttons are fixed width. How can I get the TextBox to fill all avai...

find child image width and apply it to containing parent div jquery

I have an <img> and some <p>'s inside a <div>. I want to get the width of the child img and apply it to the width of the parent div so that the paragraphs of text will wrap to the same width as the img. I want to be able to do this to multiple iterations on the same page. Background: I am developing a wordPress theme that uses the ma...

How to get width in specified units (pt, ex, etc.)

Hi, In my script, i need to get width of an element in "ex" units (font width) Is there any way to do this using JavaScript, jQuery ? ...

How to get the maximum possible width of a div?

Hello folks, I need to know how one can get the maximum possible width of a div. Generally, a <div>'s width is limited by it's parent, meaning that it can not be larger than a certain amount. How that certain amount can be calculated? I need this to calculate if the text inside the current <div> has overflown, (since the only way to de...

In Android, how can I set a ListView item's height and width?

I want to create an interface that has one or two listviews that ultimately span the entire screen with two rows. How can I change their height so that they take up 50% of the screen, vertically? If it's along the same lines, I'd love to know how to do this regardless of orientation. With regards to width; let us say I have two listvi...

WPF Label adapt FontSize to it's Width and Height

Hi all, I need to develop a Label control in WPF, on .net 3.5 and VisualStudio 2010, which FontSize automatically makes the text fill the control area. I dont know if create a CustomControl inheriting from label or create a UserControl which contains a Label control. I've seen an example here using a ValueConverter, but I'am not under...

how to prevent html table widths from enlarging due to huge one word

suppose I have a table: <table width="100"> <tr> <td> hi i like you you are awesome blah blah blah no no no no </td> </tr> </table> then the table will be displayed with 100px width just fine but then if the table becomes: <table width="100"> <tr> <td> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

Binding to a ScrollViewer's ViewportWidth and ViewportHeight

I am using the Model-View-ViewModel architecture in a WPF application I am building, and I would like a specific ViewModel to actually be reactive to the size of the view (not a normal use-case of the MVVM approach, I know). Essentially, I have a ScrollViewer object and I want the viewmodel to observe the width and height of the scrollv...

Why is this ul exceeding the size of it's div?

Although li.textmenu has width: 140px, padding: 5px, and div.textmenu has width: 150px, the one list item i've made so far has a big left margin, and extends beyond the right edge of the div by a good 30px. Could someone explain why? http://www.briligg.com/frailty.html css: div.textmenu { background-color: #3b3b3b; ...

Adjusting div width and height after rotated

If I have these rules: width:50px; height:100px; -moz-transform: rotate(0deg) and then an event changes the transform to: -moz-transform: rotate(90deg) logically, shouldn't that automatically exchange the width and the height? I need the rotate to switch width and height for accurate position detection. Thanks, Joe ...

Javascript alternative height, width control.

is there away to use a different positioning system for elements. where you don't change the width and height of the element instead you can change it using left,right, top, bottom more or less like the flex controllers? ...

HTML scroll bar width

I would like to know if there is any scroll bar property in HTML to change the width of the default scroll bar in HTML. The default size of the scroll bar is 13px. is it possible to increase the the pixel value. Can anyone help... ...

PHP & FPDF: Calculating justified text width

Hi guys, so I'm using FPDF in PHP to programmatically generate a PDF file from images and text (not HTML). One of the biggest issues I've been having is being able to wordwrap text around an image. My current algorithm looks like: Get text as an array of words Add words one at a time to a 'current line' variable, and call GetStringWid...

Center Iframe Horizontally Without Specifying Width/Height CSS

Hi, I have this Iframe which I'm looking to center using css, but is there a way to do it without specifying the height and width of the object? Thanks! ...

Limiting the width of a TextBlock in Silverlight

The obvious MaxWidth gets ignored and the text in the "DisplayBox" TextBlock displays the whole text even if this text continues past the parent container controls (to the edge of the silverlight area. <win:HierarchicalDataTemplate x:Key="hierarchicalTemplate" ItemsSource="{Binding _children}"> <Border BorderThickness="0" BorderBrus...

How can i increase the button width dynamically depends on the text size in iphone?

Hi Buddies, I have created 10 buttons programmatically and set the titles in the button. Now i want to increase the button frame size dynamically,its depends on the text. I given some conditions and set the frame size. but how can i set the exact frame size depends on the text(get the text dynamically). Here my sample code is, f...

Android - How much space does a TextView take

How much space does a TextView take? When I declare a TextView, is it possible to calculate how much space (height and width) it is going to take when actually rendered on the phone? I have noticed that based on the different screen sizes of phones (or density), the TextView is rendered accordingly. I want to be able to calculate the e...

Table attribute width is ignored

Hey, I'm working on a "little" software project for work. The goal is to generate a html file with tables and export them into pdf. Unfortunately I cant get the table to act like I want. One part of the table should display a timescale with days on the lowest row, weeks,months and years are in the rows above an have a pre-calculated ...

IE8 ignores td width, works on IE7

Greetings, I've been trying to make a site work for half a day to no avail. IE8 is bad for my mental state. So, there is a table looking like this: <table width="100%"> <tr id="header"> <td colspan="2"></td> </tr> <tr id="center"> <td id="left" style="width: 201px"></td> <td id="mainpage" style="width: 100%"></td> </tr> </table> ...