CSS in the table header

How to apply the color of the table header.

I want to say, suppose I have 3 columns in the table, for each column header, I need to apply a color.


example of table

ID

Status

County

name

Brand

NUM of series

Address

City

State

Zip

Thank you

NGO

Here is the solution

write in the css file.

. {CustomTableheaderColor1}

background-color: rgb (159, 159, 223);

color: black;

make-weight: bold;

}

. {CustomTableheaderColor2}

background-color: rgb (241, 213, 213);

color: black;

}

. {CustomTableheaderColor3}

background-color: rgb (241, 241, 213);

color: black;

}


call this custom in af:column class header styles




Tags: Java

Similar Questions

  • JTable with custom column model and model table does not display the table header

    Hello

    I create a JTable with a custom table model and a custom column template. However the table header is not displayed (Yes, it's in a get). I have narrowed the problem down in one compilable example:

    Thanks for your help.
    import javax.swing.*;
    import javax.swing.table.*;
    
    public class Test1 extends JFrame
    {
         public static void main(String args[])
         {
              JTable table;
              TableColumnModel colModel=createTestColumnModel();
              TestTableModel tableModel=new TestTableModel();
              Test1 frame=new Test1();
    
              table=new JTable(tableModel, colModel);
              frame.getContentPane().add(new JScrollPane(table));
    
              frame.setSize(200,200);
              frame.setVisible(true);
         }
    
         private static DefaultTableColumnModel createTestColumnModel()
         {
              DefaultTableColumnModel columnModel=new DefaultTableColumnModel();
              columnModel.addColumn(new TableColumn(0));
    
              return columnModel;
         }
    
         static class TestTableModel extends AbstractTableModel
         {
              public int getColumnCount()
              {
                   return 1;
              }
    
              public Class<?> getColumnClass(int columnIndex)
              {
                   return String.class;
              }
    
              public String getColumnName(int column)
              {
                   return "col";
              }
    
              public int getRowCount()
              {
                   return 1;
              }
    
              public Object getValueAt(int row, int col)
              {
                   return "test";
              }
    
              public void setValueAt(Object aValue, int rowIndex, int columnIndex)
              {
              }
         }
    }
    Published by: 802416 on October 14, 2010 04:29
    added
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    See http://download.oracle.com/javase/6/docs/api/javax/swing/table/TableColumn.html#setHeaderValue (java.lang.Object)
    When the TableColumn is created, the default headerValue is null
    So the header ends up rendered empty label (probably of size 0 if the JTable calculates its size of header based on the size of the default rendering tool).

    It worked:

         private static DefaultTableColumnModel createTestColumnModel()
         {
              DefaultTableColumnModel columnModel=new DefaultTableColumnModel();
                    TableColumn col = new TableColumn(0);
                    col.setHeaderValue("Header Title");
              columnModel.addColumn(col);
                    return columnModel;
         }
    

    Published by: jduprez on October 14, 2010 14:09
    Beaten by a fraction of a second!

    Published by: jduprez on October 14, 2010 14:10
    OK, by a split of 17 minutes, specifically: o)

  • hide the table header

    Hi, I have a requirement that, in some of the screens ADF component table must be displayed without a header (only data need to be), so I found the counting code to remove the header of the table below. But this code works in the world, which means that all tables in my project lose their headers. So the question is how can I make specific to a single table.

    AF | : column-to-head-cell {}
    display: none;
    }

    I use jdev 11.1.1.3

    Thank you.

    Hi Alain

    You must first create a styleClass and then assign this styleClass to all the tables that do not have headers.

    So first you css create the styleclass:

    tableNoColumnHeaders af | : column-to-head-cell {display: none ;}}

    And after that in your jsf code:

    That should do the trick. Only, the table with assigned styleclass has no header.

    Concerning

    Luc Bors

  • Table of contents - do not enter the table header overflow

    Hey,.

    In my table of contents, I listed two styles:

    1 table of contents Title Page

    2 - the ToC table header

    I also have my table set up correctly - headers, so when a Table flows to a second page - table headers appear in this second page as it should. The tables are large - and not the way to avoid overflow. I think that the principle is called "Text Threading" - but it also works with the tables.

    In the majority of cases - the implementation works perfectly.

    HOWEVER when the table flows to a second page - TocTable header does not appear in the Table of contents regenerated.

    For example, the table of contents looks like this:

    Electric Page 6

    Machine X - Y - Z Page 6

    Electric Page 7

    Electric Page 8

    When it SHOULD look like this:

    Electric Page 6

    Machine X - Y - Z Page 6

    Electric Page 7

    Machine X - Y - Z Page 7

    Electric Page 8

    Machine X - Y - Z Page 8

    Is this possible? I have looked at all - and cannot find all the options.

    Thank you!

    Clarify: X-Y-Z Machine is the title of the table, and he appears in a header row (repetition) over a several page table? And you want each occurrence of table header appear in the table of contents and not only the first occurrence?

    I don't think it will work this way. Header lines is modified on the first page of a table: other pages just repeat the info, but it is not accessible. It would work if you put the title of table above the table (not inside) and it repeated manually at the top of the pages. It's more work, but it will get the desired result. You mentioned that it doesn't happen that often, so maybe that's a doable "workflow" for you.

    That said, most of the TOCs brings you to the first page of a chapter, section, paragraph, and table and do not repeat the entry when the chapter, section, paragraph or a table contains more than one page. If I have sought to your table of contents and wanted to see the section on electricity, I have to stop and wonder what page to go to the first. I think that eventually, I would choose the premiera.

  • How to hide the table header if no data is present

    Hello

    I need to hide the heading for the table if no data is present. Table a, column 5. If no matter what clolumn gave this section table should not be display.

    I use <? If: count (Installation_Event_S19) = 0? > but this is not a job for me.

    Could you please help me.

    Thank you

    Sylvie Kumar


    I think you want to show/hide a table that if its conditions of licence exists and have some value. You can have an if condition including the table.

  • Unable to move the table header id advance where multiple selection is used

    Hello
    We have a page of the OFA using custom tables and rows headers in the sections of lines we used several LOV selection using the table of actions (and we did it with success.,)

    Now my question is, the header value is failed in the lines that I create by selecting the lines of creation.

    For example:
    the header ID is 101
    the selection of multiple lines for the creation.
    create lines with success but id header does not pass in one of the lines in the header of line level table id column.

    TNX in advance.

    Hello

    I used the code for similar requirements below. Please check if its useful for you.

    Here, I take the current header ID value and check line lines whole vo seen headerID as null and setting the current headerID for these lines headerID.

    code processFormRequest
    {
    OAViewObject HeaderVo = (OAViewObject) am.findViewObject ("CreateHeaderVO1");
    Line OARow = (OARow) HeaderVo.getCurrentRow ();
    "" String headerIDValue = row.getAttribute ("ReqHeaderId") + "";
    Serializable [] params = {headerIDValue};
    am.invokeMethod ("insertDetails", params);

    }

    code the insertDetails method in AM as below:

    {} public void insertDetails (String HeaderID)

    OAViewObject linevo = (OAViewObject) getLineVO2 ();

    int headerId1 = Integer.parseInt (HeaderID);

    rowCount int = linevo.getRowCount ();

    Line row = linevo.first ();

    for (int i = 0; i)<>
    {

    oracle.jbo.domain.Number headerId = (oracle.jbo.domain.Number) row.getAttribute ("ReqHeaderId");
    Row1 OARow = (OARow) linevo.getCurrentRow ();

    if(headerId==null)
    {

    Row1.SetAttribute ("ReqHeaderId", headerId1);
    }

    line = linevo.next ();
    }

    } //end insertDetails()

  • White pages being inserted between the body and the table header

    Hello

    When I fill a textbox extensible in a line of body of table with large amounts of text (about 2 pages worth) I get a blank page is inserted after the first line of table header before the first line of the table body.

    I have attached a sample form that demonstrates this problem and also attached the sample text in a separate text file.

    Any suggestions on how to solve this problem would be greatly appreciated.

    Thank you

    This is a case where using a table is more difficult. I created another example which shows how to do this.

    Note that I put the version target 9 (I think remember me that the fields when not allowed out through)

    pages in version 8, but I'm not 100% sure).

    Paul

  • Column &amp; the table header

    Hi, I need your advice on how to create these positions in a table. The application should look like this:

    Products
    Competitor brand
    1     7           a     d
    2     8           b     e
    3     9           c     f


    where there are different from 2 columns 1,2,3 and 7,8,9
    a, b, c and d, e, f are also 2 different columns;
    overall, there are 4 columns.
    For the 'products', I made the identical table for all 4 columns, & it worked well, "products appears as a header of table for all columns of 4.»
    My problem is to "Brand" and "Competitor" column headers I tried to make the column header in the 1st 2 columns of 'Brand', but they appear as separate column heading in each column. I need to 'Mark' to be a cap of 2 columns.

    Please advice. Thank you very much

    Janne

    Published by: user5860439 on June 22, 2010 21:00

    Published by: user5860439 on June 22, 2010 21:27

    On the second and fourth columns, instead of naming the columns the same as the previous that you did, simply a 'space '. Then add borders to make groupings stand.

    Edited by: David_T on June 23, 2010 08:41

  • set the width of the table header

    I have a fairly simple VI that resizes columns in a listbox MC based on the size of the text. The only thing I do not know how to implement is including the row headings. I don't see a property to set the width of the row header cell. Suggestions?

    Column = - 1

  • Repeat them bar change in the table header

    Hi all

    I need to have all my ongoing table headers a table at the bar change to have repeat on all pages, but the change only appears on the first page.

    How can I get the bar to change header on every page of my table?

    I have 11 of FrameMaker, Windows 7.

    Thank you!!

    You'll have to pretend using a graph of the change bar in a framework anchored in the first line of table position (set to be outside the column. FM repeat had an in a cell header on the following pages, but it won't for a change bar.

  • Problem with buttons in the table header repeated

    I have a bunch of respective tables that expand/collapse at the simple click of a button in their header lines.

    The problem I have is when a table to another page that the button does not work in header repeated - scripted value isn't what makes the repeat button (I also tried the checkboxes).

    Is there a way to get there? Should I try using variables to store a flag or something like that?

    https://Acrobat.com/#d=m7zuQYiUoFrtz5isD7rErQ

    You can use the layout methods to tell you if your table spans two pages or one and if she can't you change the + to a - for all instances of this button. The code would look like this on the Initialize event. :

    If

    (xfa.layout.pageSpan (this.parent.parent) > 1) {

    this.resolveNode("caption.value.#text").value

    = "-";

    }

    It works fine but if I click the button on the second page then the 1 button on the page is out of sync and needs to be reset as well.

    Paul

  • Change the fonts of the Table header, background color of the property node?

    Can I change the font size, color and the background color of the cell for any cell in a table, however, I can't seem to do it for the headers.   Is it possible to do this?

    have you tried to use an index of-1?

    Ben

  • Question how to freeze the top of the table line

    I try to freeze the top of a table row, so when you scroll the top line is fixed.

    I tried to use a CSS Style sheet and the link to the table. I can get the top row to freeze but the columns align not when you scroll the page.

    Thanks if anyone can help. It is my coding...

    < id of the table = "name of width ="1135"border ="2"align ="center"cellspacing ="2">"

    < thead style = "" >

    < b >

    < th = width "306" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < h3 > < style strong = "color: rgba (248,240,241,1)" > < facilities > data < / h3 > < /th >

    < th = width "62" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < AA h3 > < / h3 > < /th >

    < th = width "76" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < SSAA h3 > < / h3 > < /th >

    < width th = "111" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < strong data > < / strong > < /th >

    < width th = "111" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / h3 > < /th >

    < width th = "63" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / h3 > < /th >

    < width th = "44" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / h3 > < /th >

    < width th = "43" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < EC h3 > < / h3 > < /th >

    < th = width "60" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < h3 > < strong data > < / strong > < / h3 > < /th >

    < th = width "37" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / h3 > < /th >

    < th = width "60" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / h3 > < /th >

    < th = width "107" bgcolor = "#B7383A" style = "color: rgba (247,238,238,1)" > < data h3 > < / strong > < / h3 > < /th >

    < /tr >

    < / thead >

    link to stylesheet to table

    @charset "utf-8";

    / * CSS document * /.

    / * Table Styles * /.

    table #name

    {

    border: 3px solid black

    }

    Th {}

    }

    border-collapse: collapse {;}

    border-spacing: 1;

    }

    Table #name th, table #vigor td {text-align: center}

    table thead {} #vigor

    line-height: 12px;

    text-transform: uppercase;

    position: fixed;

    padding: 0px

    }

    table thead th {} #name

    padding: 0px

    }

    If you could please help, I would appreciate...

    There is a trick to this:

    Fixed the Table header - http://alt-web.com/

    Nancy O.

  • How can we define the styles TableHeading and row in the Table

    We have created a style of Product_Table. When a user inserts a new table using this style, we would like that the table header and the text of the table to use our TableHeading and TableText models, not the default styles. We have two writers who are very fluent HTML and RoboHelp and could not find a way to achieve this goal. The end result is that users must manually apply styles TableHeader and TableText after insertion of the table.

    Thanks in advance for any help.

    Carol

    HR will not work with HTML table headers. You must create a table Style

    using the pod of Style. It is not intuitive for the first time and I think I put

    something on my site about this.

    Then you insert a table using the icon and apply the table registered to that style.

  • Hanging table header

    I have a table in a Section for each.  A table will have a header of table as below

    Recipes for the Northeast

    < insert here the table >

    Revenue-West

    < insert here the table >

    the problem is if the table does not fit on a page, then it will go to the 2nd page but the table header is always on the 1st page.  I can't do a split page from a page can contain more than 1 table.  Only the last table on a page has this issue.

    How can I do for the table header will be on the 2nd page with his table if the table does not fit on the 1st page? In this way, it looks better

    I use the latest version of BEEP on windows

    Choose your topic "Recipes for West"-> right click-> paragraph-> line and jumps-> Dungeon page later.

    This will ensure your position and table go together always.

Maybe you are looking for