Multi-coloured text in table cell

I have a table where individual cells can have multi-coloured text. To do this I use html when I set the text in a cell renderer. It works fine. However, when the column width is too narrow for the text then the text is wrapped. If the text is not html then the text is not wrapped.
How can I keep the different colours but make sure the text is not wrapped?
Thanks

I never want the text to wrap even if the column width is too small for the text.
If the text of the renderer was set to abcdefghijklmnand the column is only large enough to show the first 10 chars then the user (obviously) would only see the first 10 chars.
If I now set the text to <html>ab<font color="#ff0000">cde</font>fghijklmn</html> then, assuming the column is wide enough, the user will see all the text but cde is shown in red.
However, if the column width is now changed so there is only room to show the first 10 chars then the user will only see abcde not as I would hope abcdefghij

Similar Messages

  • Multi line issue in Table Cell Editor

    Hi,
    I am developing an occasionally connected application for handheld devices using NetWeaver Mobile 7.1. In one of the view, I have a table which display items information from the data source. In one of the column I need to display item description so I used TextEdit in the Cell Editor to display the information in multi line format and also wrapping is enabled.
    But during testing of the application the TextEdit control does not wraps the text and as well as only first line of TextEdit control is visible inside the table and rest of the rows are not visible because of table's row height is not adjusted to the TextEdit control. I couldn't find any option to vary the size of the row height of the table.
    Please suggest a solution to bring multi line display with in the table.
    Also, check out my other issue posted here.
    [Issue in wrapping of text in TextEdit control|Issue in wrapping of text in TextEdit control]
    Thanks in advance.
    Regards,
    DVR.
    Edited by: Vinodh Raj D on May 28, 2009 8:18 AM

    Hi Vinodh,
                   Mutliline text in a text view/edit control inside a table cell is not supported.
    You can view multiline text in a text view/edit as a seperate control inside a view. I think in case you want to see the whole address you can create a detail(s) view which can be navigated from the list (table) view.
    Regards,
    Nipun

  • Find/change colour tint in table cell

    Hi everyone,
    I have a document containing a heap of tables. The tables currently have a tint of 15% black in some of the rows and I need to change this to 5% black. I also need to change the stroke weight from 0.5pt to 0.3pt.
    Since there are so many of them, I wondered if there was a way to do this with find and change. The tables aren't objects - they're just regular tables inserted into the text frames.
    Appreciate any help.
    Thanks

    Sorry to come back to this post but I'm still trying to figure out how to adapt the script suggested at this link: http://forums.adobe.com/thread/681944
    I'm assuming I need to swap out some values but  how would I adapt it so that it looks for table cells coloured with 20% black and changes them to 10% black.
    As mentioned previously, my javascript knowledge is limited so I'd need some guidance.
    Any further advice appreciated.

  • Mail.app: text in table cells in incoming formatted mail - problems replying

    MacOS 10.9.2
    mail.app  7.2, threading enabled
    Sometimes I receive a formatted email that is really difficult to reply to, when I want to intersperse my reply text among the incoming paragraphs.
    The trouble occurs when multiple incoming paragraphs are grouped. I can’t open up vertical space for my reply  text inside the groups. 
    If I click anywhere in the group, mail.app marks the group with a surrounding rounded-corner grey rectangle, with a X-in-a-circle “close icon” at the upper left corner. 
    When I look at the raw source of the incoming message, I see that the groups correspond to table cells, that is, the sending mail client enclosed the paragraphs within a <td> … </td> pair.
    The sending email client is sending me a table, for no clear reason — the group doesn’t correspond to anything obvious in the message thread.
    I’m guessing we won’t ever know why some email clients group paragraphs like this, but I’d like to do my best to adapt, so I can keep up with my incoming email. 
    Yeah, I can ask my correspondents to use a different email client, or perhaps different settings in the same client, but except for the few tekkies among my correspondents, this isn’t really practical.  I can also ask my clients to use unformatted messages, but THAT is a whole different issue, and frequently isn’t practical, either.
    My questions:
    Q1:  What’s the point of the grey rectangle and the  “close icon”?    (Is this mail.app’s way of saying, “I received this crazy formatting, almost impossible to process, so I’m making it easy for you to just delete the whole mess”?  Or what?)
    Q2:  Is there any SIMPLE way to untangle (modify or remove) these groupings within mail.app?  (I guess I can access the raw html, copy-and-paste it into another app, modify it, and paste the results back into my reply.  Yuck!)
    Q3: Am I missing a really obvious work-around or fix?
    TIA

    In your question, you indicated that you are running Firefox 8. Is that correct? It might be difficult to diagnose issues with that version because most people have moved on to Firefox 12 (plus or minus 1 version). Can you upgrade?
    It's hard to think of a reason that ordinary text or links in ordinary text would not display. For embedded images or videos, one possibility is a difference in the protocol, i.e., HTTP (not secure) versus HTTPS (secure).
    Hopefully someone else will have a better guess (or actual knowledge!).
    Regarding the blue lines in a message, that usually indicates the earlier message was forwarded a few times. I don't know whether Gmail will let you reformat that area or whether you have to clean it in another application (e.g., for plain text, in Notepad) and paste it back in.

  • Text Field over Text in Table Cell

    When I drag a new text field to a table cell that contains text the field automatically fills the cell and overwrites the text.  Can I put a field over the text in a specific position and how do I do it?  (See Screen shot)

    Thank you for the idea bruce.  I did try that and tried it again just now.  I've attached a screenshot of the result.  It fills the cell and gives me a blue outline with no resizing nodes.  I must be missing something on how to resize the subform.  Any more ideas?

  • Dragging Text in Table Cell

    In older versions of Pages, dragging text from a table cell into another table cell would cause the 2 cells to swap text. In '09 the dragged text overwrites the text in the cell it's dropped into. Is there a way to go back to the old way?

    No not that I know of.
    I have tried all the possible keyboard combinations and none do what you want.
    Peter

  • Set text in table cell to bold

    I am trying to get the text in a table cell to alternate between plain and bold on a ctrl-click.
    The setFont() statements seeming have no effect.
    Can anyone help?
    Self Contained thing here:
    package boldTableCell;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableModel;
    public class MyTable extends JTable implements MouseListener {
         private boolean isBold = false;
         private String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
         private Object[][] data = {
                   {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
                   {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
                   {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)},
                   {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
                   {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)},
          * constructor
         public MyTable() {
              super();
              DefaultTableModel defaultTableModel = new DefaultTableModel(data, columnNames);
              this.setModel(defaultTableModel);
              this.setName("My Table");
              setListeners();
          * set listeners
         private void setListeners() {
              addMouseListener(this);
         // on ctrl-click in variable column, flip bold/not bold
         @Override
         public void mouseClicked(MouseEvent event) {
              System.out.println ("mouseClicked(): # of clicks: " + event.getClickCount());
              // ctrl -click
              if ((event.getModifiers() & ActionEvent.CTRL_MASK) > 0) {
                   System.out.println("ctrl-click");
                   Point point = event.getPoint();
                   int row = rowAtPoint(point);
                   int column = columnAtPoint(point);
                   // if not valid then return
                   if ( row < 0 || column < 0) {
                        return;
                   // if this click was on the variable column
                   if (column == 0) {
                        System.out.println("ctrl-click on column 0 ");
                        Component component = super.prepareRenderer(this.getCellRenderer(row, column), row, column);
                        // now get the current font used for this cell
                        Font font = component.getFont();
                        isBold = ! isBold; // flip boolean
                        if (isBold) {
                             System.out.println ("ctrl-click: bold: " + isBold);
                             component.setFont(font.deriveFont(Font.BOLD));
                             component.setForeground(getForeground()); // otherwise text disappears
                             //     (JLabel)t.getHeaderRenderer()).setFont(new Font(("Courier", Font.BOLD, 12));
                        else { // not bold
                             System.out.println ("ctrl-click: not bold: " + isBold);
                             component.setFont(font.deriveFont(Font.PLAIN));
                             component.setForeground(getForeground()); // otherwise text disappears
                        component.invalidate();
                        component.repaint();
                        this.invalidate();
                        this.repaint();
                   } // end if click on definition column
         } // end mouseClicked
         @Override
         public void mouseEntered(MouseEvent arg0) {
         @Override
         public void mouseExited(MouseEvent arg0) {
         @Override
         public void mousePressed(MouseEvent arg0) {
         @Override
         public void mouseReleased(MouseEvent arg0) {
          * @param args
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception e){
                   e.printStackTrace();
              final JPanel jPanel = new JPanel();
              final MyTable myTable = new MyTable();
              jPanel.add(myTable);
              final JFrame frame = new JFrame();
              frame.add(jPanel, BorderLayout.CENTER);
              frame.setTitle("My Panel");
              frame.setPreferredSize(new Dimension(400, 150));
              frame.addWindowListener(new WindowAdapter(){
                   @Override
                   public void windowClosing(WindowEvent e) {
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setLocation(300, 200);
              frame.pack();
              frame.setVisible(true);
    }Edited by: allelopath on Jul 8, 2010 11:06 AM
    Edited by: allelopath on Jul 8, 2010 11:07 AM

    got it
    package boldTableCell;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    public class MyTableWithCustomRenderer extends JTable implements MouseListener {
         private boolean isBold = false;
        private List<Boolean> isBoldList;
         private String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
         private Object[][] data = {
                   {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
                   {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
                   {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)},
                   {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
                   {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)},
          * constructor
         public MyTableWithCustomRenderer() {
              super();
              // initialize bold for each row to false
              isBoldList = new ArrayList<Boolean>(5);
              for (int row = 0; row < 5; row++) {
                   isBoldList.add(row, false);     
              DefaultTableModel defaultTableModel = new DefaultTableModel(data, columnNames);
              this.setModel(defaultTableModel);
              this.setName("My Table");
              setListeners();
          * set listeners
         private void setListeners() {
              addMouseListener(this);
         // on ctrl-click in column 0 , flip bold/not bold
         @Override
         public void mouseClicked(MouseEvent event) {
              // ctrl -click
              if ((event.getModifiers() & ActionEvent.CTRL_MASK) > 0) {
                   System.out.println("mouseClicked(): ctrl-click");
                   Point point = event.getPoint();
                   int row = rowAtPoint(point);
                   int column = columnAtPoint(point);
                   // if not valid then return
                   if ( row < 0 || column < 0) {
                        return;
                   // if this click was on column 0
                   if (column == 0) {
                        isBoldList.set(row, ! isBoldList.get(row)); // flip boolean for this row
                        this.invalidate();
                        this.repaint();
         } // end mouseClicked
         @Override
         public void mouseEntered(MouseEvent arg0) {
         @Override
         public void mouseExited(MouseEvent arg0) {
         @Override
         public void mousePressed(MouseEvent arg0) {
         @Override
         public void mouseReleased(MouseEvent arg0) {
        @Override
        public Component prepareRenderer (TableCellRenderer renderer,int row, int column) {
            Component component = super.prepareRenderer(renderer, row, column);
            // now get the current font used for this cell
            Font font = component.getFont();
            if (column == 0) {
                 if (isBoldList.get(row)) {
                      System.out.println ("prepareRenderer(): ctrl-click: bold: " + isBold);
                      component.setFont(font.deriveFont(Font.BOLD));
                      component.setForeground(getForeground()); // otherwise text disappears
                 else { // not bold
                      System.out.println ("prepareRenderer(): ctrl-click: not bold: " + isBold);
                      component.setFont(font.deriveFont(Font.PLAIN));
                      component.setForeground(getForeground()); // otherwise text disappears
              return component;
          * @param args
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception e){
                   e.printStackTrace();
              final JPanel jPanel = new JPanel();
              final MyTableWithCustomRenderer myTable = new MyTableWithCustomRenderer();
              jPanel.add(myTable);
              final JFrame frame = new JFrame();
              frame.add(jPanel, BorderLayout.CENTER);
              frame.setTitle("My Panel - Custom Renderer");
              frame.setPreferredSize(new Dimension(400, 150));
              frame.addWindowListener(new WindowAdapter(){
                   @Override
                   public void windowClosing(WindowEvent e) {
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setLocation(300, 200);
              frame.pack();
              frame.setVisible(true);
    }Edited by: allelopath on Jul 8, 2010 2:07 PM

  • Styled Text in Table Cell

    Hi,
    I've got this problem: I'd like to insert a styled text in some cells of a JTable.
    The text should be composed of two kinds of Font, to emphasize some characters in it.
    Suppose I've done a class Test, that extends JPanel. In this class I've done a method appendChar(String c, boolean bol). With this method I can add a JLabel with only a single char (String of length 1) at a time. If bol is true, it emphasizes the char; if false, it uses the "default" font. For example:
    "this is an example"
    This class works fine, but I don't have any idea on how I could be able to insert a Test instance in a JTable cell.
    I think I should create a class that implements TableCellEditor, or extends DefaultCellEditor.. but I don't know how this should be done.
    If there is some other way to have some styled text in a table cell, tell me!

    Hi,
    AFAIK, the default renderer for a table cell is a JLabel in which you can display styled text using html. You would need to provide a custom editor only if the default textfield doesn't fulfil your needs. For rendering, you need to override the renderer.
    Cheers,
    vidyut

  • Copy text in table cells  Framemaker 10

    I want to copy the content of several table cells in an other table of the same document. How can I do this so that the text is copied in several cells again and not all the content in only one cell?
    Margot

    Normally, just make sure you select the same array of cells in both source and destination table. If they don't match, geometrically, it may not work. This might happen, for example, if you have a straddle in one but not the other.
    If the tables need to have identical content for some cells going forward, consider having the clone table's cells populate the shared cells with cross-references, by paragraph text, to the master table. Then if the master table changes, so does the clone.

  • Inserting text into table cells in Powerpoint

    Hi
    I have a named table ClientInfo on Slide 3 in Powerpoint. How can I programmatically insert text into the table's cells?
    Thanks
    Regards

    Hi Yahya,
    What did you mean named table? Did you mean the name of shape?
    If I understood correctly, we can use table object to manipulate a table shape on a slide. And here is a sample to insert text into the first cell for your reference:
    Application.ActivePresentation.Slides(3).Shapes("ClientInfo").Table.Cell(1, 1).Shape.TextFrame.TextRange.Text = "Hello"
    Also here are some helpful links for learning PowerPoint developing:
    How do I... (PowerPoint 2013 developer reference)
    Object model reference (PowerPoint 2013 developer reference)
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to change the colour of the table cell editor on some condition?

    Hi all,
    I have a requirment acco which i need to make the colour of the tableceleditor ias RED and font color white when the data in that is < 0.please tell me how is this possible and its urgent..
    regards
    Sharan

    If you are using release NW04 and have a TextView as table cell editor, you can do this:
    Add a calculated attribute "Color" of DDIC type "com.sap.ide.webdynpro.uielementdefinitions.TextViewSemanticColor" under the data source node of the table.
    Bind the "semanticColor" of the cell editor to this context attribute.
    Implement the get-method for the calc. attribute like this
    WDTextViewSemanticColor get<DataSourceNode>Color(I<DataSourceNode>Element element)
      return element.getValue() < 0 ? WDTextViewSemanticColor.NEGATIVE : WDTextViewSemanticColor.STANDARD;
    Armin

  • How to change the colour of a table cell boder?

    I have just changed from Dreamweaver MX t CS5 and cannot find how to add a colour to the borders of a table and table cells.  In the old MX it was easy just selected the colour for border in properties but in CS5 this option is not availble.  Have tried formatting with CSS but this only colurs the outer boarder can anyone help?

    Not sure what you mean by a custom class would it be possible to give me an example?

  • [CS2-JS] Error when inserting some text in table cell via XMLElement

    I have a very very strange InDesign behaviour when using XMLElement in a table Cell to insert a string.
    For example (in a table that has an XML structure) :
    var cell = table.cells[0];
    var cell_xe = cell.associatedXMLElement;
    var newtag_xe = cell_xe.xmlElements.add("mytag", null);
    // Up to now, no problem
    // Then I use only one of these following instructions at a time :
    newtag_xe.contents = "existe en 4,57 x 1,07 m"; // Gives an InDesign error "Object is invalid"
    newtag_xe.contents = "existe en 4,57 x 1,07 "; // Works fine
    I have a lot of other examples of that kind (not only failing on the last character). InDesign accepts (randomly, it seems) some strings and rejects some others, and no logical rule seems to emerge.
    Anyone with the same problem ?

    Hi Cyril,
    re: "This is where I think InDesign is really not fair : myTextFrame.tables.length == 0 if the table cannot be seen because of vertical overflow !!!"
    I disagree. If the table does not appear in the text frame, then it shouldn't be in the text frame object. If the table appeared as a child of the text frame when it does nto appear in the frame (when it might have moved to another text frame in the story), it would be even more confusing.
    This points out the danger of relying on the text frame as the container--instead, use the parent story of the text frame, which will contain all of the text in the story, regardless of whether it's visible or not.
    Thanks,
    Ole

  • Cannot rotate text in table cell

    I am using LiveCycle Designer 8. I want to rotate the text in the top row of a table so that the text is displayed vertically. I have created a simple 3 column, 2 row table. I select one of the cells in the top row (I click in the cell and the cell borders are highlighted). When I go to the "Layout" tab the "Rotate to 90", "Rotate to 180" and "Rotate to 270" buttons are "active" (meaning they are not greyed out and when I click on them, they move just as you would expect a button to move). The problem is that the cell does not rotate when I click on any of those three buttons. It's as if Designer simply ignores my click.
    Since I am relatively new to Designer, my first question is: am I going about this correctly? If not, how do I rotate text vertically in a table? If I am doing it correctly, what can I do to fix this problem?
    Thanks.

    Tim, you're not doing anything wrong.  That was a bug in Designer 8 that has since been fixed.  <br /><br />To get around your problem, try manually adding rotate="90" to that particular cell in the XMLSource.<br /><br />So you would have something like:<br /><draw w="30mm" h="22.2238mm" name="Cell1" rotate="90"><br /><br />Steve<br />Adobe Systems

  • Multiline text in table cell

    Hi all,
    I have used the oracle as the database.
    My tabel consists of some columns.
    Eg: 3 cols are there for name and father name
    Iam displaying the data using the Table Model.
    But I want to have the name and father name in a single cell
    like:
    name
    father name
    micheal
    Mr. Johnson
    name and father name is the heading which should be in a single cell
    michael and Mr. Johnson are the values which should be in a single cell
    How can I do this?

    Since you can't use the formatted UI elements, you will need to remove the XHTML formatting.  I would suggest perform text replacement and removing the
    <p>
    completely and replacing the
    </p>
    with cl_abap_char_utilities=>cr_lf. 
    Try that with the textView. If the carriage return isn't used in the text view, you might swap the UI element to a disabled textEdit UI element instead.

Maybe you are looking for