HTML Element alignment using Jquery - alignment

I have a table with three columns, the first column takes an image, the second takes a heading label and third is very small and is empty.
The Heading label in second column is being centered to the center of the column but what I want is to center it in the middle of the screen at the same height it is present at. I used jquery window width but couldn't attain the result required. The heading label is made up of two labels.
please help....!

Why you use table.Insted of table use divs.Here i paste the code for that
you want to align the center of <div id="myDiv"></div> to the center of <span id="mySpan"></span> write
$("#myDiv").align({left:{my:0.5,at:0.5, selector:'#mySpan'}, top:{my:0.5,at:0.5, selector:'#mySpan'}});

Related

How to check if an image contains horizontal or vertical text region

I have images with text written vertically in some cases and horizontally in others. I need to process horizontal and vertical text images differently. Hence, for that I need to first check if the image contains a vertical text or not.If someone can suggest some way of finding if an image contains vertical text or not, it will be helpful. For example see the following imageshttps://i.stack.imgur.com/A5txz.jpg and https://i.stack.imgur.com/7LU28.jpg. The first one contains a vertical text and the second one contains a horizontal text.

Autolayout - How to align with longest item

Suppose I have a view that contains two columns of objects. The first column contains labels, and the second column contains, say, sliders. I want the sliders all to align left with each other. I want the labels all to align left with each other. The trick is, how can I set the spacing between the labels and sliders so that the default spacing is used between the left sliders and the longest label, thus:
label 1 slider 1
label 2 slider 2
longer label 3 slider 3
very long label 4[]slider 4
label 5 slider 5
I've placed square brackets, [], where the default spacing should be. Is it possible to add this sort of constraint in the storyboard (iOS 7)? If so, how? The trick is that I don't know which label is the longest, especially with localization.
Ideally, I could specify a bounding box around the labels and align the sliders with the right side of the bounding box.
Yes, you can do this in IB. All the labels should have their left edges aligned, and one of them should have a fixed space to the left edge of their superview (all the elements should be enclosed in a UIView). Similarly, the sliders would have their right edges aligned and one of them would have a fixed space to the right edge of the box. Give one of the labels a horizontal spacing constraint to a slider -- make that a short one, say ==8 with a priority of 900 (that's the important thing). Now, give all the labels a >= constraint with whatever value you want for the minimum spacing (and leave the priority at 1000).

align portion of label to right

I have a label that needs to have a portion of it aligned to the right.
For example if this is the text box:
|left.........right|
If there is no easy way to align right... I have an idea, but I'm not sure it's possible but here it is:
I could calculate the width of the right string by adding the width of the pixels of each character, a fixed width font is ideal. With this I could calculate amount of spaces I need to insert to get the text all the way to the right.
<div style="width:200px">
Left
<div style="float:right;">Right</div>
</div>

removing space around components in blackberry

I have a gui that keeps scrolling on the 8520 screen. I have used setPadding(XYEdges) and setMargin(XYEdges) to remove the spaces around the components on the UI but there's still space left in between these components. Are there other API calls i can make to remove spaces around components?
You need to consider the following:
setPadding refers to a boundary inside the border of a field and controls how close the internal content of the field can be to the border.
setMargin refers to a boundary outside the border of a field and controls how close the field can be to an adjacent field on that edge.
BUT note that the margins of adjacent fields overlap, so that if field A has it's right margin set to 0, and right adjacent field B has it's left margin set to 20, then the two fields will still be placed no closer than 20 pixels apart.
i.e. you have to take into account the margins set for the edges of all adjacent fields.
Returning to padding, the same applies for managers if you set their internal padding. This will determine how close to the inside of the manager's border an included field can be placed.
Somewhere in the blackberry documentation and/or support forum, there is a document explaining this pictorially, I just can't find my link to it right now, but will post it here when I find it again.

How do I make a TCheckListBox scroll vertically?

I've got a TCheckListBox on a form. Its Columns property is set to 2, and if there are more items than can fit on-screen in two columns, it puts a horizontal scrollbar across the bottom of the control.
Thing is, the way this form it laid out, it would be much more convenient to scroll vertically. But I can't seem to figure out how to make the box do that. I thought setting Columns to 1 should work, but it doesn't.
Anyone know how to make a TCheckListBox scroll vertically instead of horizontally?
You need to set Columns to 0.
For all positive values the VCL sends a LB_SETCOLUMNWIDTH message to the underlying native list box control, with the width parameter set to the list box client width divided by the number of columns. Items that don't fit will start a new column with the same column width, so the horizontal scrollbar becomes visible.
If Columns is 0 then there is a single column that spans the entire client width of the list box, and items that don't fit will make the vertical scrollbar visible, and hide the horizontal scrollbar.
Edit:
There seems to be genuine interest what happens when a negative value is used for the Columns property.
The method TCustomListBox.CreateParams() sets the LBS_MULTICOLUMN list box style depending on the Columns property being different from 0. For negative values the style flag is set, but the VCL doesn't send the LB_SETCOLUMNWIDTH message, so the native control uses the default column width. It is documented to be:
15 times the average character width for the font used by the list box.
(Search for "The LBS_MULTICOLUMN style specifies" to find the relevant passage of text.)

Resources