width

Combining fixed and variable width columns in one table

戏子无情 提交于 2019-12-11 04:17:01
问题 How can I create a table with CSS like the following (the first three columns with a fixed width in px and the following columns with a width in %): I know how I can create a column with variable or fixed width. 回答1: Nest another table for the 4 columns on the right. The HTML structure would look like: <table class = "big first"> <tr> <td class = "px10">Cell1</td> <td class = "px20">Cell2</td> <td class = "px30">Cell3</td> <td> <table class = "big"> <td>1</td><td>2</td><td>3</td><td>4</td> <

Can I use Jquery to automatically find and set the width and height of a variety of images?

筅森魡賤 提交于 2019-12-11 04:08:45
问题 I am using the Masonry Plugin and for it to work correctly with images, you need to set the width and height within the image tag. All the image's heights will vary, but the width will be set at 200px. Is there a way for Jquery to detect the height of each image and set it's height? That way I don't have to go set the height of every single image. Does this make sense? Hope someone can help! I am new to Jquery. 回答1: Yes there is, you can use jquery custom selectors like this: //Add custom

Inline image and caption in article - conform caption's width to image's width

帅比萌擦擦* 提交于 2019-12-11 03:27:47
问题 Here's my code: <div class="image"> <img src="image.jpg" alt="Image description" /> <p class="caption">This is the image caption</p> </div> Here's my CSS: .image { position: relative; float: right; margin: 8px 0 10px 10px; } .caption { font-weight: bold; color: #444666; } As is above, the caption will conform to the width of div.image. My problem is often the img varies in size, from 100px width to 250px width. I'd like to make the caption width conform to the corresponding width of the image

Is it possible to adjust the width of a UITableViewCell?

a 夏天 提交于 2019-12-11 03:27:12
问题 I would like to know if it is possible to adjust the width of a UITableViewCell. I would like to put an image to the left of it (like the Contact view in Address Book). I found a post here that provides a picture of exactly what I am trying to accomplish. I would also like to confirm the answers to this post. 回答1: OS3.0 has some style options in the API that may do what you want. Or, you can create a completely custom table view cell within Interface Builder, for example in one of my apps I

Android custom action bar with action buttons

血红的双手。 提交于 2019-12-11 03:16:45
问题 Here is the action bar that I want to create. Here is items that I put in menu. <item android:id="@+id/search" android:title="Search" android:showAsAction="ifRoom|collapseActionView" android:actionLayout="@layout/search_layout" /> <item android:id="@+id/search1" android:title="PHOTO" android:showAsAction="ifRoom" android:actionLayout="@layout/search_layout" /> collapseActionView - collapses search menu on startup. After click on search item it shows edit text like on picture 1. But I need

Width of child control should match width of parent container

試著忘記壹切 提交于 2019-12-11 03:14:16
问题 I'm pretty new to WPF. I often find my self struggling with getting a bunch of child controls combined width to match a given parent container.. As in the following: <ListBox x:Name="BrugereListBox" Grid.Column="0" Grid.Row="3" DataContext="{DynamicResource Brugere}" ItemsSource="{Binding}" PreviewMouseLeftButtonDown="BrugereListBox_MouseLeftButtonDown" PreviewMouseMove="BrugereListBox_PreviewMouseMove" > <ListBox.ItemTemplate > <DataTemplate > <Border BorderBrush="Black" BorderThickness="1"

$(element).outerWidth(true) reports differently based on theme?

断了今生、忘了曾经 提交于 2019-12-11 02:47:36
问题 I have a jQuery script, this sets an element's width to 50% via the normal CSS width attribute. If I then output the outerWidth(true) of that element to get the exact pixel value, it sometimes does not correspond to $(window).width()/2 - this is based on the theme that the site has. Unfortunately I cannot bring a demo for this behavior online. Is there any specific CSS attribute that might cause such a difference? The problem is that the outerWidth() is reporting for example, 564px , but when

Setting fixed width size of view with pt/mm/in ANDROID

妖精的绣舞 提交于 2019-12-11 02:28:28
问题 I'm trying to set fix width to a view. “in”, “mm”, and “pt” are density independent and the same size on every device or i am wrong? My view width should be 141.3pt/49.8mm , so i am setting in the XML android:layout_width="141.3pt" or via code: float requiredPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PT, (float) 141.3, dm); ViewGroup.LayoutParams params = mRequiredSizeLine.getLayoutParams(); params.width = (int)requiredPx; mRequiredSizeLine.setLayoutParams(params); The thing is

Equal height columns width issue

亡梦爱人 提交于 2019-12-11 02:17:53
问题 I have 3 columns that extend to equal height. The only problem now is that if I have 2 columns only they expand their width and take 100% of the main container. So basically I need them to have the same width wether it's 1, 2 or 3 columns. Any idea on how to achieve this? Many thanks! Fiddle Demo .content > img { vertical-align:top; } #wrapper { height: 100%; width: 100%; margin: 20px auto; display:table; overflow: hidden; border-spacing: 30px; } #wrapper > .col { display: table-cell; width:

jquery .height() and .width() on span tag gets inconsistent results

こ雲淡風輕ζ 提交于 2019-12-11 01:04:39
问题 I need to get the dimensions of a variable-height-and-width element, #sentence , in order to change the dimensions of other elements that are related to it. #sentence is centered in the browser window, and its height and width are determined whatever its contents are. My code looks like this: HTML <body> <div id="wrapper"> <div id="cell"> <span id="sentence"> sentence </span> </div> </div> </body> CSS body, html { font-size: 18pt; padding: 0px; margin: 0px; overflow: hidden; } #wrapper {