text-alignment

Align text in a UIAlertView that has a scrollbar

那年仲夏 提交于 2019-12-11 12:55:47
问题 If a UIAlertView contains a certain amount of text, the text display is automatically changed to have scrollbars. I would like this text to be centre-aligned. Searching around for the solution provides this SO response. However, this does not work on a UIAlertView that contains scrollbars. How do I align the text in such an alert? 回答1: My suggestion would be to not do this. It could break with any iOS update if Apple changes the way that UIAlertView is structured. That being said, you can do

text-align justify, cannot override

此生再无相见时 提交于 2019-12-11 04:08:03
问题 I have some text with text-align: justify; the property is inherited in links and other nested inline elements in that text. I want to set other text-align mode to some of them, for example text-align: center; , but I cannot. Firebug shows that the parent style is overridden, but the nested inline element is still justified. I observed that strange behavior in many different browsers and obviously they are doing this by spec? Is that really by design? How to work around it? EDIT: Some example

Text Alignment in Jasper with HTML markup

試著忘記壹切 提交于 2019-12-11 00:53:33
问题 I want to align text for static text with html markup. I tried for p tag with both align and text-align property. Seems that both does not take effect. <p align="right">Right 1</p> <p text-align:right>Right 2</p> I know that jasper report supports very few of html tags according to http://community.jaspersoft.com/questions/539009/html-tags-supported-jasper-reports-v-371 Is is possible to achieve this on japser version 6.0.3? Any help is greatly appreciated. 回答1: Using <textField> with

How do I vertically center the text within a flex element?

孤街醉人 提交于 2019-12-10 20:34:56
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 6 years ago . Is there a special way to vertically center text in an element using flexboxes (or other pure CSS)? Fiddle: http://jsfiddle.net/WK_of_Angmar/JZZWg/ <body> <div id="main"> <section id="a">Test1</section> <section id="b">Test2</section> </div> #a { flex: 1 0 auto; } #b { flex: 0 0 auto; min-height: 3em; background-color: yellow; } #a { background-color: blue; } #main { display: flex;

Center footer UILabel in grouped UITableView - Swift

北战南征 提交于 2019-12-10 17:56:51
问题 I'm currently adding an information page to my app, and wish to display the version number of the app centred in the footer of a grouped UITableView. I have it displaying, but I'm not sure how to go about centring it. I've looked at using the tableviews viewForFooterInSection; would this be the correct way going forward, or is there a simpler way? Many thanks in advance. 回答1: Simply just add a footer to your tableView and it will be placed at the bottom, no matter how many sections you have

How to vertically center text in textarea?

人盡茶涼 提交于 2019-12-10 14:47:59
问题 Is there a way to vertically center text entered in textarea with known width and height? I have a fixed-sized textarea where text should be typed in and I want the text to start from the center while you type it. Horizontal centering could be done with text-align:center, but I cant find any way to align horizontally. 回答1: I think you cannot do the vertical alignment directly. You should make another div over the text area and use it to make text vertically aligned and take the inputs from

How to align rotated text in the middle of a div

纵然是瞬间 提交于 2019-12-10 13:38:29
问题 I would like to vertical align rotated text in the middle of a 100% height div, like the image below. So whenever the screen size changes the text stays in the middle of the div. Anyone has a solution for this? http://jsfiddle.net/SVkPU/1/ .rotate-270 { -o-transform: rotate(270deg); -moz-transform: rotate(270deg); -webkit-transform: rotate(270deg); transform:rotate(270deg); } .left { float:left; background:#000; color:#fff; text-align:center; height:50px; } .right { float:right; background:

AutoEllipsis=true affects the vertical positioning of the text

喜你入骨 提交于 2019-12-10 13:04:59
问题 I have a label with AutoEllipsis = true and TextAlign = ContentAlignment.MiddleLeft . When I enter a text that is not extending the label width, the text is vertically aligned to the middle of the label. However, when the text extends the label width the text is not aligned to the middle, but top aligned instead. Why is it behaving this way, and is there a way to keep the text vertically center aligned? 回答1: I see it. This looks like a limitation in the underlying winapi, DrawTextEx(). Which

How does one have centered text and right-floating text on the same line, when everything has dynamic widths?

喜欢而已 提交于 2019-12-10 12:34:33
问题 I have a variable size block of text, which I would like centered in a div. The width of the div is a % of its parent element, and the height is defined by padding however tall the center text is. This is easily achieved via: <div style="width: 50%; padding: 15px; text-align: center;"> Lorem ipsum... </div> That works fine. But when I try to add the part on the right: <div style="width: 50%; padding: 15px; text-align: center;"> Lorem ipsum... <div style="float: right;">ASDF!</div> </div> then

How to print a list of dicts as an aligned table?

妖精的绣舞 提交于 2019-12-10 11:54:11
问题 So after going through multiple questions regarding the alignment using format specifiers I still can't figure out why the numerical data gets printed to stdout in a wavy fashion. def create_data(soup_object,max_entry=None): max_=max_entry entry=dict() for a in range(1,int(max_)+1): entry[a]={'Key':a, 'Title':soup_object[a].div.text.strip(), 'Link':soup_object[a].div.a['href'], 'Seeds':soup_object[a](attrs={'align':'right'})[0].text.strip(), 'Leechers':soup_object[a](attrs={'align':'right'})