Vertical alignment of text in a cell doesn't work
In Numbers 3.2, the vertical text alignment seems to have no effect on the text. Whether I select the text itself, the cell, or the row, pressing one of the vertical alignment buttons for top, middle, or bottom does nothing.
I've searched through all the menus but I don't see anything to affect this. Alignment in the menu is of the left, right, justify variety, not top, middle, bottom.
My goal is to reduce the padding in a row so that I can squeeze the text right up to the cell borders, but Numbers doesn't seem to allow me to do this. Yet I have someone else's number sheet, and it's obviously possible since they have it in their sheet.
Thanks for any help,
Confused newb
AlizaG wrote:
Annoyingly, when I searched for my question I was only shown questions that were not related to this one. Now that I've posted it, the related questions are shown in the sidebar and lo and behold: other people have had this problem too...
The culprit is the automatic text inset of 4 pts. Drastically un-intuitive.
Aliza,
Only un-intuitive if you believe that most people would like their cell content lying right against the cell border.
Jerry
Similar Messages
-
JTable How to align the Text in a Cell to Centre
Hi Plese Help regarding JTable.
I want to align the Text in the Table Cell to Centre how to align it. Im using Abstract Data Model TAble an what is the meaning of renderer and its use.. Help me outHere are a couple of links you should read for information on tables and renderers:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender
http://www-106.ibm.com/developerworks/java/library/j-jtable/index.html?dwzone=java
Here is an example of a simple renderer that will:
a) center the text
b) highlight the background when the cell gets focus
This renderer is only used in two of the columns of the table.
import java.awt.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableRenderer extends JFrame
public TableRenderer()
String[] columnNames = {"Date", "String", "Integer1", "Integer2", "Boolean"};
Object[][] data =
{new Date(), "A", new Integer(1), new Integer(5), new Boolean(true)},
{new Date(), "B", new Integer(2), new Integer(6), new Boolean(false)},
{new Date(), "C", new Integer(3), new Integer(7), new Boolean(true)},
{new Date(), "D", new Integer(4), new Integer(8), new Boolean(false)}
DefaultTableModel model = new DefaultTableModel(data, columnNames);
JTable table = new JTable( model )
// Returning the Class of each column will allow different
// renderers to be used based on Class
public Class getColumnClass(int column)
return getValueAt(0, column).getClass();
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
// Create cell renderer
TableCellRenderer centerRenderer = new CenterRenderer();
// Use renderer on a specific column
TableColumn column = table.getColumnModel().getColumn(3);
column.setCellRenderer( centerRenderer );
// Use renderer on a specific Class
table.setDefaultRenderer(String.class, centerRenderer);
public static void main(String[] args)
TableRenderer frame = new TableRenderer();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
** Center the text and highlight the focused cell
class CenterRenderer extends DefaultTableCellRenderer
public CenterRenderer()
setHorizontalAlignment( CENTER );
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (hasFocus)
setBackground( Color.cyan );
else if (isSelected)
setBackground( table.getSelectionBackground() );
else
setBackground( table.getBackground() );
return this; -
"Vertical Align Center" Text and a Shape
Hi designers,
I wonder if anyone could give me a hand with aligning text and shapes? I would like to align a number to the center of a circle. "Horizontal Align Center" works well. "Vertical Align Center", however, does not yield the desired result. The number turns out to be higher in the cycle (see figure below). The distance from the top of the circle to the top of the number zero, X, is shorter than the distance between the bottom of the circle and the bottom of the number zero. Is it possible to equal these two distances?
Figure 1: The Outcome of Vertical Align Center
Thanks,
HaoboHi Mylenium,
Thank you very much for you very prompt reply, which solves the problem very effectively.
If you do not mind, I have got two further questions.
Firstly, is there an option similar to "Align to Path: Centre" under "Type on a Path Options" that changes how text is aligned?
Secondly, does InDesign offer the aforementioned function?
I sometimes label a large quantity of locations with alphanumeric characters, which are subject to frequent changes, and therefore would like to preserve the text if possible. I have heard that manipulating text is InDesign's area of expertise. If this function is not available in Illustrator but offered by InDesign, I can jot down another reason for acquiring the latter and split the workflow in the future.
Thanks,
Haobo -
Vertical alignment in text form
Been trying set vertical alignment so that text will align with the top of the form box, and having a frustrating result. It will only align if the box is one line only.
A multi-line box will not expand vertically to accomodate long text; an expanded (vertically) box will result in text beginning below top alignment. Anyone working on a fix for this? It seems to be a new problem, as I have used this feature with in the past with old versions of Acrobat.If I understand your issue correctly, you can achieve this by playing witht the Left and Right values under Layout tab of the object properties.
Let me know if this is not what youare looking for..
Thanks
Srini -
How do I vertically align my text to center within a div?
any solutions?
nevermind I found a way to do it. It's probably not the most efficient way but since I only have a single line of text within the div I managed to vertically center the text using line height. I am new to web design and have been studying and watching tutorials for the last month on dreamweaver. I am getting better but I must say dreamweaver is quite glitchy when it come to accurately displaying the actual design of the webpage in split view. Only when I view my work in line view can I actually see what is really going on.
-
Ctrl+C closes tab instead of copying text and Ctrl+F doesn't work
Hi,
As stated in title, since upgrading Firefox to the latest version, when I press Ctrl+C it closes the tab I'm on instead of copying text. It can be text from a website or text from an email i'm writing. Estremely frustrating, as I've come to the habit of copying the text of an email I'm sending using Yahoo Mail before sending in case it doesn't send properly and gets lost!!!
Also, I usually pressed Ctrl+F to search for a specific piece of text on a website, but this simply doesn't work. Any ideas?
I use the Welsh language version of Firefox, and the same problem occurs on both my home laptop and work PC.Super annoying, but I've realised '''Ctrl+Shift+T''' opens the last tab to be closed and that is a great help until a fix comes along.
-
Standard Text with ' include' option doesn't work with order created by FM
Hi ABAPers,
Standard text with 'Include' Option does not work with all the Order created via the Function Module SD_ORDER_CREATE_WWW. Where as Order created via VA01 display the Standard text with 'Include'.
On my analysis I found that, Order created via FM use the '*' 'Comment' instead of ':/' 'Command' in the script editor. So the Standard text inserted was considered as a Text instead of command.
Hence issuing print or print preview, the Script display the INCLUDE statement instead of the text.
Can you please let me know the reason and the way to rectify it.
Thanks & Regards
N.Suresh KumarHi.
Make that * command as /: and try in ur program..
It works..
Hope it helps...
Cheers,
Simha. -
Highlighting text jumps all over - doesn't work - help
Can't get the text highlighting to work. Seems like when I try to highlight, the browser does "whatever it wants, except highlight what I want. Clicking repeatedly causes it to jump around like some kind os a sppoky game!!!! What the hell is this? I never had this problem before the current version of Firefox. I think I will have to abandon Firefox for a browser that actually works, like Chrome.
Create a new profile as a test to check if your current profile is causing the problem.
See "Creating a profile":
*https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
*http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
*http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox -
Vertically align middle input text in a text box
I'm creating Flash-based software that has text boxes where users write in the answers to questions. I want the text that the user types to be vertically aligned to the middle of the text box, so that even if the response is two or three lines, it is still centered in the box.
It doesn't appear that I can accomplish this through the properties window in Flash. Am I missing something? Or is it possible to set the properties of the text box with actionscript, and would that allow me to vertically align the text?
Thanks!You're not the first to ask this, but if you got an answer of how to do it, you'd likely be the first. I don't think it is possible since there doesn't appear to be any sort of top margin property available for TextFields. You might be able to fake something like that though if you think about it... like using the changed event of a textfield to reposition it vertically in a pseudo border/bkgnd.
If you do come up with a solution, you should share it here... as I said, you're not the first to ask. -
Basic questions about word spacing and vertical alignment with CSS
I'm sill very new to Dreamweaver and web page designing. I've
read the entire manual SC3, one book, and starting another but I
have almost 0 practice.
Q1. so far I haven't been able to produce the effect of the
Word Spacing property. I tried all kinds of tests and I don't know
in what scenario this effect will show. Can someone give me a
simple example that shows the effect of this CSS property.
Q2. Vertical Alignment: this works well with images inserted
into text but I also expected this to work with text against other
text. For example I typed TEST© and assigned a different SCC
style to the © so that I can make it smaller and put it up
with the Vertical Alignment property. Surprisingly this propery
didn't produce any effect. How is htis suppose to be done?> This is some text. This is some text.
You forgot to wrap your text in <p> tags so the style
rule you created
doesn't apply.
Walt
"emil emil" <[email protected]> wrote in
message
news:[email protected]...
>
quote:
Originally posted by:
Newsgroup User
> i don't know about Q1. but for Q2. just delete what you
already have for
> the copyright symbol, and then insert the copyright
special character.
> there's a couple ways to do it: on the main menu at the
top of the
> window, go to Insert, then HTML, then Special
Characters, and select
> Copyright. or you can also find it in the Insert panel,
which is below
> the menu, under Text. ...
>
>
> Thanks courtney, but that was exactly the way I created
the © character
> and
> like in this text here it needs to be scaled down and
moved up
> independently
> from the surrounding text. Can someone please post a
simple code showing
> the
> effect of the vertical alignment of text in relation to
surrounding text.
>
>
>
quote:
Originally posted by:
Newsgroup User
> Q1
>
> <html>
> <head>
> <style type="text/css">
> p
> {
> word-spacing: 30px
> }
> </style>
> </head>
> <body>
>
> <p>
> This is some text. This is some text.
> </p>
>
> </body>
> </html>
>
>
> Thank you Ken, your code works but not the code
generated from
> Dreamweaver
> when I type in the Design View and assing CSS style to
the p tag. Does
> Dreamweaver have trouble generating properly working
HTML or I'm missing
> something here? Here is the code that Dreamweaver
generates and the word
> spacing doesn't work with it.
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
> <title>Untitled Document</title>
> <style type="text/css">
> <!--
> p {
> word-spacing: 50em;
> }
> -->
> </style>
> </head>
>
> <body>
> This is some text. This is some text.
> </body>
> </html>
>
>
> -
Vertical align to center in a div
Hi,
I'm putting together a css layout in dreamweaver CS3, i have a basic nav bar with a solid black colour with text on top. I'm trying to vertical align the text to the center, currently it's center horizontally, but the text is right at the top of the div. The only way i've been able to change the position is to use "line height"
Any there any easy way to do this in css?
Any help is much appreciated, thanks.Hi again,
I'm having a bit of trouble trying to get my main text area vertically center on one of my pages, i have a two column layout(text area on the right). The above methods don't seem to work, they just seem expand my whole bodyArea downwards.
Currently my codes look like this:
Layout:
<style type="text/css">
<!--
body {
background-color: #666666;
#wrapper #bodyArea #left {
background-image: url(images/picture.jpg);
float: left;
background-repeat: no-repeat
-->
</style></head>
<body>
<div id="wrapper">
<div id="logo"></div>
<div id="nav"><a href= nav text here </a></div>
<div id="bodyArea">
<div id="left"></div>
<div id="shadow"></div>
<div id="right">text with paragraphs here</div>
<div id="footer">copyright info here</div>
</div>
</div>
</body>
</html>
stylesheet:
#wrapper {
width: 781px;
margin-right: auto;
margin-left: auto;
height: 699px;
#wrapper #logo {
height: 116px;
background-image: url(../images/logo.jpg);
#wrapper #nav {
height: 38px;
text-align: center;
color: #FFFFFF;
font-family: "Courier New", Courier, monospace;
font-size: 19px;
line-height: 38px;
background-repeat: no-repeat;
background-color: #000000;
margin: 0px;
#wrapper #bodyArea #left {
width: 341px;
float: left;
height: 507px;
#wrapper #bodyArea #right {
width: 440px;
float: right;
height: 507px;
text-align: center;
color: #000000;
vertical-align: middle;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
#wrapper #bodyArea #right #shadow {
height: 14px;
background-image: url(../images/shadow.gif);
background-repeat: repeat-x;
#wrapper #bodyArea #footer {
height: 38px;
clear: both;
text-align: center;
color: #FFFFFF;
background-color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
line-height: 38px;
margin: 0px;
p {
margin-top: 0px;
margin-right: 10px;
margin-bottom: 15px;
margin-left: 10px;
I'm fairly new to CSS layouts, if anyone could help me it would be much appreciated, thanks. -
Centering text in a cell in a JTable
Hi,
I have a program that reads in data from a text file and display it in a JTable. My problem is that the data in each cell is not centered, it is left justified within that cell.
How can I fix this.
--kirkTo align a text inside a cell you have to go through the rendering classes of a Jtable. You can do lots of formatting by using a render class. Heres my code that i use.
1. The first code aligns your data centered inside the cell.
2. The second code aligns it like code1 but has an additional character to be printed beside your data inside the text.
///////////// TO USE THE RENDER CODE IN YOUR APPLICATION /////
TableColumn col1 = table.getColumnModel().getColumn(1);
col1.setCellRenderer( new SimpleRenderer());
or
TableColumn col1 = table.getColumnModel().getColumn(1);
col1.setCellRenderer( new SimpleRenderer( "$" ));
///////////// RENDER CODE IS HERE //////////////
import javax.swing.table.*;
import javax.swing.border.*;
import javax.swing.*;
import java.awt.*;
public class SimpleRenderer extends JLabel implements TableCellRenderer
Border unselectedBorder = null;
Border selectedBorder = null;
String text = "";
Color foreColor = Color.black;
Color backColor = new java.awt.Color( 217,217,255 );
Color selectedColor = new java.awt.Color( 217,217,255 );
public SimpleRenderer()
super();
setHorizontalAlignment( JLabel.CENTER );
setOpaque( true );
} // end of CONSTRUCTOR
public SimpleRenderer( Color foreGround, Color backGround )
super();
setHorizontalAlignment( JLabel.CENTER );
setOpaque( true );
this.foreColor = foreGround;
this.backColor = backGround;
} // end of CONSTRUCTOR
public SimpleRenderer( String data )
super();
text = data;
setHorizontalAlignment( JLabel.CENTER );
setOpaque( true );
} // end of CONSTRUCTOR
public Component getTableCellRendererComponent(
JTable table, Object object, boolean isSelected, boolean hasFocus,
int row, int column)
try
if ( backColor != null )
if ( (row % 2 ) == 1 )
setBackground( backColor );
else
setBackground( Color.white );
if ( foreColor != null )
setForeground( foreColor );
if ( hasFocus )
if ( isSelected )
setBackground( selectedColor );
else
setBackground( Color.white );
String newData = "" + object;
if ( newData.trim().equals( "" ))
setText( "" );
else
setText( text + " " + object );
if (isSelected)
if (selectedBorder == null)
Border border, raisedBevel, loweredBevel;
raisedBevel = BorderFactory.createRaisedBevelBorder();
loweredBevel = BorderFactory.createLoweredBevelBorder();
Border colorLine = BorderFactory.createLineBorder(Color.red);
border = BorderFactory.createCompoundBorder( raisedBevel,loweredBevel);
selectedBorder = BorderFactory.createCompoundBorder( border, colorLine);
setBorder(selectedBorder);
else
if (unselectedBorder == null)
unselectedBorder = BorderFactory.createMatteBorder(0,0,0,0,
table.getBackground());
setBorder(unselectedBorder);
catch( ClassCastException e )
return this;
} // end of GETTABLECELLRENDERERCOMPONENT method.
public void setForeColor( Color data )
foreColor = data;
} // end of SETFORECOLOR method.
public void setBackColor( Color data )
backColor = data;
} // end of SETBACKCOLOR method.
} /** end of CLASS **/
///////////// -
Vertical alignment in Smartforms.
Hi,
I am working in a smartform, where my requirement is i have to place the text both vertically and horizontally center aligned.
Now i have used to center aligned in my style. but the text is horizontally center aligned not vertically.
Please help me in this. How to display a text module vertically center aligned.
Thanks and Regards,
Mohanraj.N
Edited by: Mohanraj Natesan on Nov 2, 2009 2:23 PM
Edited by: Mohanraj Natesan on Nov 2, 2009 2:37 PMHello,
For vertical alignment of text, you can use a trick with the line spacing.
Use the space before and space after and adjust in such a wat that the text will appear as center alignled vertically.
say for eg: you set the space before = 2 mm and space after as 2 mm, so the space before the text and after the text would be 2 mm and thus the text will appear as center alligned vertically.
But you have to also take care of line spacing while adjusting the space before and space after.
Hope this help you.
Regards,
Sachinkumar Mehta -
I just upgraded my IPhone to IOS 7.1 and now the speech to text function and Siri doesn't work
The microphone icon is white not grey
And when I hit it it only stays on for a split second
Not long enough to dictate a message
It worked fine before upgrade
And works on IPad which I also just upgraded
Help??There are many, many threads on this forum about this issue. Do a forum search for "wi-fi greyed out" and see if any of the solutions therein will work for you. Best of luck.
-
JTextField - Setting the column size doesn't work. Help, please.
Hi,
I want to set the column size of a text field from another text field by the input from the user. However, it just doesn't work. The following is my code. Just check out the last anonymous inner class action listener. Somehow i can get the user text, but it just doesn't work.
Thanks for any helpful inputs.
* Introduction to Java Programming: Comprehensive, 6th Ed.
* Excercise 15.11 - Demonstrating JTextField properties, dynamically.
* @Kaka Kaka
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
public class Ex15_11 extends JFrame{
// Create two text fields and three radio buttons
private JTextField jtfUserText = new JTextField(10);
private JTextField jtfColumnSize = new JTextField(new Integer(10));
private JRadioButton jrbLeft = new JRadioButton("Left");
private JRadioButton jrbCenter = new JRadioButton("Center");
private JRadioButton jrbRight = new JRadioButton("Right");
public static void main(String[] args){
Ex15_11 frame = new Ex15_11();
frame.pack();
frame.setTitle("Excercise 15.11 - Text Field Property");
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// Start of Constructor
public Ex15_11(){
// Set the the frame layout
setLayout(new BorderLayout(5, 5));
// Create three panels and two labels
JPanel jpText = new JPanel();
JPanel jpHorizontalAlignment = new JPanel();
JPanel jpColumn = new JPanel();
JLabel jlblTextField = new JLabel("Text Field");
JLabel jlblColumn = new JLabel("Column Size");
// Create a button group for the radio buttons to be grouped
ButtonGroup group = new ButtonGroup();
// Group the radio buttons
group.add(jrbLeft);
group.add(jrbCenter);
group.add(jrbRight);
// set a titled border for a panel
jpHorizontalAlignment.setBorder(new TitledBorder("Horizontal Alignment"));
// Create a line border
Border lineBorder = new LineBorder(Color.BLACK, 1);
// the all the components to their corresponding panels
jpText.add(jlblTextField);
jpText.add(jtfUserText);
jpHorizontalAlignment.add(jrbLeft);
jpHorizontalAlignment.add(jrbCenter);
jpHorizontalAlignment.add(jrbRight);
jpColumn.setBorder(lineBorder);
jpColumn.add(jlblColumn);
jpColumn.add(jtfColumnSize);
// add the panels to the frame
add(jpText, BorderLayout.NORTH);
add(jpHorizontalAlignment, BorderLayout.WEST);
add(jpColumn, BorderLayout.EAST);
jrbLeft.addActionListener(new ActionListener(){
// Handle event
public void actionPerformed(ActionEvent e) {
jtfUserText.setHorizontalAlignment(SwingConstants.LEFT);
jrbCenter.addActionListener(new ActionListener(){
// Handle event
public void actionPerformed(ActionEvent e) {
jtfUserText.setHorizontalAlignment(SwingConstants.CENTER);
jrbRight.addActionListener(new ActionListener(){
// Handle event
public void actionPerformed(ActionEvent e) {
jtfUserText.setHorizontalAlignment(SwingConstants.RIGHT);
// Register the listener for the coloum size
jtfColumnSize.addActionListener(new ActionListener(){
// Handle event
public void actionPerformed(ActionEvent e) {
System.out.println(Integer.parseInt(jtfColumnSize.getText()));
jtfUserText.setColumns(Integer.parseInt(jtfColumnSize.getText()));
}Edited by: ChangBroot on Dec 16, 2008 6:13 PMdon't forget to revalidate the JPanel after changing the components it holds:
jtfColumnSize.addActionListener(new ActionListener()
// Handle event
public void actionPerformed(ActionEvent e)
System.out.println(Integer.parseInt(jtfColumnSize.getText()));
jtfUserText.setColumns(Integer.parseInt(jtfColumnSize.getText()));
jpText.revalidate();
});This will tell the jpText JPanel's layout manager to relayout the components that this JPanel holds. It should resize your JTextField. Note that in order to call this from within the anonymous inner ActionListener jpText will need to be declared "final". Either that or declared as a class field.
Maybe you are looking for
-
My iTunes library no longer appears in my remote app. I know it is not a Home Sharing issue because the library is linked to my Apple TV. However, it won't appear in my remote app on my iPhone 6 or my iPad Air. Hasn't worked since the update to iT
-
Internal Batch number not getting generated
Dear Experts, We want to generate internal batch numbers during production order creation. To achieve the same , the following Customization settings were done: 1. Acitvate Internal Batch number assignment (T-code OMCZ) 2. Maintain Internal Batch num
-
External Hard Drives: One for backup and one for storage
Is it possible to have two external hard drives, one firewire and the other usb, using one as an additional hard drive, and the other as the backup drive, and backup from the external that is the additional hard drive to the the other which is the ex
-
Full Screen Preview is Soft in Bridge CS4
I'm experiencing some notable softening of images when previewing them with full screen toggled on or when viewing images as a slide show. Type of file seems irrelevant (CR2, TIFF, JPEG, etc.) nor does image size make a difference. The strange thing
-
System slow down after installing Mountain Lion OS
I recently purchased a MacBook Pro for school, and upgraded the OS to Mountain Lion. I noticed a slight slow down in the computer. Is this normal, or is there something I can do to speed it back up? SW