Background to change colour of table cell?
I have my buttons that change the backgrou color on hover but
they dont do
the full table cell only around the text.
How would i get it to fill the cell?. Ive tried differnt
padding options
but non work.
.buttons a:hover {
background-color: #CC3333;
display: block;
TIA
Mike wrote:
> I have my buttons that change the backgrou color on
hover but they dont do
> the full table cell only around the text.
>
> How would i get it to fill the cell?. Ive tried differnt
padding options
> but non work.
>
> .buttons a:hover {
> background-color: #CC3333;
> display: block;
>
Then you have your code set up incorrectly because the css
that you have
provided should work.
Can you provide a link to the page in question or supply the
full
code/css of the table in which these links are inserted.
Similar Messages
-
How can I save semi opaque background fill in a pages table cells?
I am trying to add background colour fill to some cells of a table. Solid, 100% fill is easy, but when I slide the opacity slider in the colours window and add to a cell, the new colour can be added to the table cell, but only saves as the full 100% colour in the saved document. I save the Pages document as a Word document. Thanks for any help.
GeorgeHow does it work if you save the document as the native .pages format? A lot of Pages features doesn't convert well to Word, or vice versa. Don't expect Pages to be a cheap Word substitute.
I can't check out what you are describing as I don't have Word.
Tip: Always save first as .pages, then you can EXPORT to another format. PDF is better format to retain what you have acheived in Pages. -
How to populate change from one Table cell to more Tables??
Dear Friends:
I have following successfully running code, each can populate 1 table cell updating in ChangeTableSelectionMain1 change to another table in ChangeTableSelectionMain1 also, or populate 1 table cell in ChangeTableSelectionSub1 change to another table in ChangeTableSelectionSub1 also, But cannot populate table cell updating in ChangeTableSelectionMain1 to ChangeTableSelectionSub1, Please advice how to make populating table cell updating in ChangeTableSelectionMain1 to ChangeTableSelectionSub1 successful??
Thanks.
[1]. main code:
package com.com;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import java.awt.GridLayout;
public class ChangeTableControl1 implements java.io.Serializable{
private JFrame frame;
public static void main(String args[]) {
try {
ChangeTableControl1 window = new ChangeTableControl1();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
* Create the application
public ChangeTableControl1() {
initialize();
* Initialize the contents of the frame
private void initialize() {
frame = new JFrame();
frame.setBounds(0, 0, 1500, 675);
final ChangeTableSelectionMain1 c1 = new ChangeTableSelectionMain1();
final ChangeTableSelectionSub1 c2 = new ChangeTableSelectionSub1();
JSplitPane sp = new JSplitPane();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setLayout(new GridLayout(1, 2));
frame.getContentPane().add(panel, BorderLayout.CENTER);
sp.setLeftComponent(c1);
sp.setRightComponent(c2);
sp.setResizeWeight(0.5);
panel.add(sp);// add right part
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.pack();
frame.setVisible(true);
}[2]. ChangeTableSelectionSub1
package com.com;
import javax.swing.JTable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TableModelEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.FlowLayout;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.text.SimpleDateFormat;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
public class ChangeTableSelectionSub1 extends JPanel{
protected JButton bt11 = new JButton("Insert before");
protected JButton bt22 = new JButton("Insert after");
protected JButton bt33 = new JButton("Delete");
protected ChangeTableSelectionMain1 lm = new ChangeTableSelectionMain1();
public ChangeTableSelectionSub1() {
JPanel pnl = new JPanel();
pnl.setMinimumSize(new Dimension(200,600));
//pnl.setPreferredSize(new Dimension(800,600));
final JTable tbl1 = new JTable(lm.data,lm.columnNames);
final JTable tbl2 = new JTable(lm.data,lm.columnNames);
JScrollPane scr1 = new JScrollPane(tbl1);
JScrollPane scr2 = new JScrollPane(tbl2);
lm.tbl1.getSelectionModel().addListSelectionListener(new ListSelectionListener()
public void valueChanged(ListSelectionEvent lse)
if (lm.tbl1.getSelectedRow()!=-1)
tbl2.clearSelection();
System.out.print("[1]. LongguChangeTableSelectionSub get msg from LongguChangeTableSelectionMain");
tbl1.clearSelection();
revalidate();
lm.tbl2.getSelectionModel().addListSelectionListener(new ListSelectionListener()
public void valueChanged(ListSelectionEvent lse)
if (tbl2.getSelectedRow()!=-1)
tbl1.clearSelection();
System.out.print("[2]. LongguChangeTableSelectionSub get msg from LongguChangeTableSelectionMain");
revalidate();
pnl.setLayout(new FlowLayout());
pnl.add(scr1);
pnl.add(scr2);
this.add(pnl);
public static void main(String []args)
ChangeTableSelectionSub1 c = new ChangeTableSelectionSub1();
JFrame frm = new JFrame();
frm.setSize(920,400);
frm.getContentPane().add(c);
frm.setVisible(true);
}[3]. ChangeTableSelectionMain1
package com.com;
import javax.swing.JTable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.FlowLayout;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import javax.swing.*;
public class ChangeTableSelectionMain1 extends JPanel{
protected JButton bt11 = new JButton("Insert before");
protected JButton bt22 = new JButton("Insert after");
protected JButton bt33 = new JButton("Delete");
protected String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
protected 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)} };
protected JTable tbl1 = new JTable(data,columnNames);
protected JTable tbl2 = new JTable(data,columnNames);
public ChangeTableSelectionMain1() {
JPanel pnl = new JPanel();
pnl.setMinimumSize(new Dimension(200,600));
//pnl.setPreferredSize(new Dimension(800,600));
JScrollPane scr1 = new JScrollPane(tbl1);
JScrollPane scr2 = new JScrollPane(tbl2);
tbl1.getSelectionModel().addListSelectionListener(new ListSelectionListener()
public void valueChanged(ListSelectionEvent lse)
if (tbl1.getSelectedRow()!=-1)
tbl2.clearSelection();
if (lse.getValueIsAdjusting())
System.out.println("Selected from " + lse.getFirstIndex() + " to " + lse.getLastIndex());
revalidate();
tbl2.getSelectionModel().addListSelectionListener(new ListSelectionListener()
public void valueChanged(ListSelectionEvent lse)
if (tbl2.getSelectedRow()!=-1)
tbl1.clearSelection();
revalidate();
pnl.setLayout(new FlowLayout());
pnl.add(scr1);
pnl.add(scr2);
this.add(pnl);
public static void main(String []args)
ChangeTableSelectionMain1 c = new ChangeTableSelectionMain1();
JFrame frm = new JFrame();
frm.setSize(920,400);
frm.getContentPane().add(c);
frm.setVisible(true);
}Message was edited by:
sunnymanmanI have following successfully running code, each can populate 1 table cell updating in ChangeTableSelectionMain1 change to another table in ChangeTableSelectionMain1 also, or populate 1 table cell in ChangeTableSelectionSub1 change to another table in ChangeTableSelectionSub1 also, But cannot populate table cell updating in ChangeTableSelectionMain1 to ChangeTableSelectionSub1, Please advice how to make populating table cell updating in ChangeTableSelectionMain1 to ChangeTableSelectionSub1 successful??
My brain hurts, does yours? -
Changing colour based on cells for ALV in Web Dynpro ABAP
Hi,
I have a requirement where I need to change the font color for some cells of ALV in Web Dynpro ABAP. I am able to change the font color for whole row or whole column but need to know how to change it based on cells.
My output should be something like the picture attached to this discussion. The coloumns/cells where I need the font colour can change for different rows, based on some internal condition.
Please let me know how to achieve this...... Thank you.
- Divya PosanpallyHi Divya,
Your requirement can be achieved as below
Create an attribute for each column of alv i.e. COLOR_F1, COLOR_F2, COLOR_F3...... COLOR_F10 of type WDY_UIE_LIBRARY_ENUM_TYPE in the context node which holds the color value
Now while configuring ALV, set the field name of semantic color for each column as below
data lv_color_fld_name type string.
data lo_text_view type ref to cl_salv_wd_uie_text_view.
loop at lt_columns into ls_column.
concatenate 'COLOR' ls_column-id into lv_color_fld_name separated by '_'.
lo_text_view ?= ls_column-r_column->get_cell_editor( ).
if lo_text_view is bound.
lo_text_view->SET_SEMANTIC_COLOR_FIELDNAME( value = lv_color_fld_name ).
endif.
endloop.
Set the color based on the condition
loop at lt_data into ls_data.
if ..... "your condition here.
ls_data-color_f1 = cl_wd_text_view=>e_semantic_color-NEGATIVE.
ls_data-color_f2 = cl_wd_text_view=>e_semantic_color-POSITIVE.
elseif...... " another condition
endif.
endloop.
Note: You can optimize the code as per your requirement
Hope this helps you.
Regards,
Rama -
JTable changing borders for table cells
Hi,
I have a JTable which has columns which each represent a month for a
specified time period. For example, my table displays rows containing numeric data for March 1998 - April 2002.
I would like to create a Raised Cell for the numeric data for the first
cell in the time series and a raised cell everytime the numeric data
is under the column for January of the new year. For example,
the cell containing the data under March 1998 column should be raised and the cells containing the data for January 1999,2000,2001,2002 should be raised.
(FYI: I am using a TableModel which extends the AbstractTableModel)
Many Thanks in advance,
AlexYou need to create a custom table cell renderer to do what you are asking. It is what actually draws the cells. Just subclass the DefaultTableCellRenderer and override the getTableCellRendererComponent() method. Look at the source for that class, and just change it to add your logic to use a different border depending on the cell to be drawn.
-
How to change colour of the Cell in a table
Hi,
Could you please let me know how to change the coluor of the cell at table.
here i m having a column called "STATUS". i m getting data from backend and filling this column with two values(success/failed).
when i get success, the cell should be in green color, when it is failed cell color should be red.
i followd below:
created a context attribute "color" of type
com.sap.ide.webdynpro.uielementdefinitions.TableCellDesign
i binded this with the column proerty "cellDesign".
when i executed bapi i sohlud get different colors according to output.
here is my execute function
wdContext.currentZemp_Compare_InputElement().modelObject().execute();
wdContext.currentUploadElement().setStatus(wdContext.currentMessageElement().getSuccess());
if(wdContext.currentMessageElement().getSuccess().length()>6)
wdContext.currentContextElement().setColor(WDTableCellDesign.GOODVALUE_LIGHT);
else
wdContext.currentContextElement().setColor(WDTableCellDesign.BADVALUE_LIGHT);
but when i get value failed it filling red for all other cells in that column
when i get value success, cells all r filling with green.
how can i get only perticual cell colur should b green/red.
plz try to solve this problem.
wer i need to do changes?
thanks in advance
venkatHi,
For your scenario, you need to have two cellVariant as TableStandardCell (say successTSC & failTSC). Add tableCellEditors to these 2 TableStandardCell as you like. Mark there variantKey property as var1 & var2 respectively.
Do change the cellDesign as you like the color for the TableStandardCell.
Bind an attribute selectedVariant to your column selectedCellVariant property.
Now in wdDoModify you can write:
for(int i=0;i<wdContext.nodeCountries().size();i++){
if(wdContext.nodeCountries().getCountriesElementAt(i).getStatus().equals("SUCC")){
// Here node countries is the datasource of your table.
wdContext.nodeCountries().getCountriesElementAt(i).setVariantKey("var1");
} else if(wdContext.nodeCountries().getCountriesElementAt(i).getStatus().equals("FAIL")){
wdContext.nodeCountries().getCountriesElementAt(i).setVariantKey("var2");
The article below will definetly help you in your requirement.
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0310fd2-f40d-2a10-b288-bcbe0810a961]
Hope this will surely solve your problem.
thanks & regards,
Manoj -
Semantic colour of Table Cell gets overwritten by Portal Theme
Hi,
In one webdynpro table, I need to show a column with Red-Amber-Green colour depending on some other column value and the colour column has no value. I have used WDTableCellDesign class constants BADVALUE_DARK (Red), CRITICALVALUE_DARK (Amber) and POSITIVE(Green) and attached it with the 'cellDesign' property of the table column to fill it with colours.
The colour shows perfect when the table row is not selected. But when the row gets selected the lead selection colour change (defined in Portal theme) overwrites the cellDesign colour and it is not possible to identify the table column colour.
My relevant Portal theme values are shown below:
complex elements->Tables->Selected Cells
Background Color of Primary Selection=#FFC54E
Background Color of Secondary Selection=#FCDD82
Background Color of Read-Only Primary Selection=#FFC54E
Background Color of Read-Only Secondary Selection=#FCDD82
complex elements->Tables->Semantic Colour
Color of Bad Value (Dark)->#F66767
Color of Critical Value (Dark)->#FBA643
Background Color of Positive Cells->#AACDA1
Can you please tell me a way to solving this problem through code and not changing the portal theme.
Regards
ArindamHi Arindam,
You can not change the color of lead selction dynamically. Also , if you use another theme specifc to your webdynpro application, then portal theme will over-shadow it.
What I guess is the color of lead selction is your problem. What you can try if you change the selectionMode property of table to None, then you can avoid this problem and you can still refer your lead slection.
Regards
Abhinav -
Got this link but cant seem to get them to work, need a
little help if possible, ill talk you through what ive done,
hopefully someone can point me in the right direction.
1st hear is the link i got the example from : .[
table cell
links
i made myself a wee demo table in dreamweaver.
created a new CSS sheet with the following:
table.navbar {
border-collapse: collapse;
table.navbar td {
border: 1px solid #ccc;
table.navbar td a{
display: block;
width: 9em;
padding: 3px;
text-decoration: none;
table.navbar td a:link, table.navbar td a:visited {
color: #000;
background-color: #fff;
table.navbar td a:hover, table.navbar td a:active {
color: #fff;
background-color: #666;
I then attached the CSS sheet to the table but only a few
minor things have changes, the entire table cell isnt showing as a
link neither is it changing color like the demo on the website.
HELP!
What and where have i went wrong, thanksI used the styles you supplied and applied it to a table 1
column x 3
rows... this is the code and it works for me....
You need to give your links an actual link, in this case I
used a null link
for demo purposes. Copy and paste the code into a new DW
window and see if
it works for you. White background, grey on hover over the
cell. Here's
another example that may be of interest (look at the code)
http://www.dreamweaverresources.com/tutorials/clickable_cell.htm
(similar
to Garys' tutorial) and
http://www.dreamweaverresources.com/tutorials/scroller.html
<!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
table.navbar {
border-collapse: collapse;
table.navbar td {
border: 1px solid #ccc;
table.navbar td a{
display: block;
width: 9em;
padding: 3px;
text-decoration: none;
table.navbar td a:link, table.navbar td a:visited {
color: #000;
background-color: #fff;
table.navbar td a:hover, table.navbar td a:active {
color: #fff;
background-color: #666;
-->
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0"
class="navbar">
<tr>
<td><a href="javascript:;">link 1</a>
</td>
</tr>
<tr>
<td><a
href="javascript:;">link2</a></td>
</tr>
<tr>
<td><a
href="javascript:;">link3</a></td>
</tr>
</table>
</body>
</html>
Nadia
Adobe� Community Expert : Dreamweaver
http://www.csstemplates.com.au
- CSS Templates | Free Templates
http://www.DreamweaverResources.com
- Dropdown Menu Templates|Tutorials
http://www.macromedia.com/devnet/dreamweaver/css.html
- CSS Tutorials -
Problem updating table Cell display
Hi, any ideas about this problem would be very much appreciated Ive had it for 6 months but have been unable to get to the bottom of it.
I have an application which contains a JSplitPane with two tables , when the application starts both tables contain the same data. The 1st table is a read view, the bottom display is an edit view. When I make a change to a table cell in the bottom view it changes colour and the corresponding cell in the top view also changes it colour (bit not value) to indicate that the cell has been edited.
The problem is that the top cell only changes colour if the top cell as displayed is large enough to show the complete value. If i then click on the cell in the top view it will correctly change colour. If I move the columns in the top pane about a bit, all subsequent modifications in the bottom pane will correctly change the cell colour in the top pane !
(My renderer extends JPanel rather than JLabel.)Make sure you fire the appropriate fireTableCellUpdated() method from both TableModel's so that the view knows to redraw that cell. Ideally, both of your tables would share the same table model, but only one would allow editing. You could accomplish that by putting a facade table model over top the real table model that just overrode the isEditable method to reutrn false always, and all other methods would pass through to the real model. That way as changes were made to the table model (no matter who made the change), the views would stay in sync because they were based on the same model, getting all the same events, etc.
-
How to change color of tables and regions in OA Framework pages
Dear all
I want to change colour of tables and regions of oracle standard pages.One way to do it is that I can add code for tables and regions CSS definitions in for each page in correspoding CO,which is not feasible since we have large number of COs in standard pages.I heard that oracle has provided some method to change look and feel of the pages.If anybody knows about it ,plz do let me know.
Thanks in advance
BhupendraCheck personalization guide and read out "Customizing Look-and-Feel (CLAF)" Topic.
-
How do I set a BG Image for a specific Table Cell?
Hello...
How do I set a Background Image for a specific table cell
without it affecting the main page background image?
thanks
JUse CSS -
td.special { background-image:url(foo.gif); }
will style this table cell only -
<td class="special">
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"JSloanSDRE" <[email protected]> wrote in
message
news:g2dl7n$pf5$[email protected]..
> Hello...
>
> How do I set a Background Image for a specific table
cell without it
> affecting the main page background image?
>
> thanks
> J -
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?
-
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.
ThanksSorry 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. -
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
SharanIf 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 -
Highlighting input field and table cell column in red colour
Hi,
I have 4 input fields and a table in my screen. All the input fields are read only.
I have a functionality where I have to highlight a input field with the red colour. In the sense, I have to put a thin Red border over the input field without thowing any errors or messages.
Also, i have to highlight a particular cell in the table. i.e, i have to put Red colour border over the cell of the table for some rows only. Right now i have changed the background colour of the cell for required rows, but i need Red thin border rather than changing the entire background colour.
Please guide me on achieving these functionalities..
Thanks and Regards,
-Shabir Rahim.Hi,
The red thin lines border you are talking about comes from the framework during the exceptions. If this is the case then refer the following links, hope this will help you.
[Re: Automatic message for inputfields with state=required]
[Re: Validation of InputField]
Well without exceptions, i dont think it will come.
thanks & regards,
Manoj
Edited by: Manoj Kumar on Feb 7, 2008 12:09 PM
Maybe you are looking for
-
"Update server not responding" when trying to update Acrobat 9 Pro
I just installed Acrobat 9 Pro on my desktop computer and on my laptop. I was able to download and install the latest updates to the copy on my desktop computer (so that it is now version 9.3.0), using Help>Check for Updates. When I try the same comm
-
XML Publisher Template Builder for Adobe Acrobat
Need a XML Publisher Template Builder for adobe acrobat as is available for word.
-
I bought some new music in iTunes and now my purchases are showing up in the purcahsed folder but will not transfer into my library- I want to get the music onto my nano. It is in my music files- I see it in the purchaed folder but only 1 of the 16
-
Application Virtualization 4.6 (SoftGrid) Acrobat Pro 9.2 and Office 2007
I'm actually trying to sequence Acrobat Pro 9.2 together with Office 2007 in a dynamic suite composition with Application Virtualization 4.6 RC. I can sequence both applications and deploy them to the client. Everything seems to work fine, except the
-
Loading multiple data from a XML file?
Hi, I'm having trouble loading multiple data from the same XML file. In this XML file I have a list of dishes I want to add into a menu. So, how can I load multiple data from different branches of the XML file into my text fields? Thanks in advance,