Print header color of p:datatable

UI Components for JSF
Post Reply
jcuascota
Posts: 2
Joined: 19 May 2015, 23:55

20 May 2015, 00:21

hi, i want to print with my printer a p:datatable of primefaces but in preview of Internet Explorer or Mozilla header of table apears without colors, please help me...!
thanks.

My css file looks like:

.mystyle.ui-datatable .ui-datatable-header {
background: #FF8000 !important;
}

.mystyle.ui-datatable .ui-datatable-header th {
background: #FF8000 !important;
}

.mystyle.ui-datatable-columns .ui-datatable-columns-header {
background: #FF8000 !important;
}

.mystyle.ui-colum {
background: #FF8000 !important;
}

.mystyle.ui-datatable .ui-datatable-even {
background: white;
}

.mystyle.ui-datatable .ui-datatable-odd.ui-state-hover {
background: #F4E7C1;
}

.mystyle.ui-datatable .ui-datatable-even.ui-state-hover {
background: #F4E7C1;
}

.mystyle.ui-datatable .ui-datatable-even.ui-state-highlight {
background: #fff9e5;
}

.mystyle.ui-datatable .ui-datatable-odd.ui-state-highlight {
background: #fff9e5;
}

.mystyle.ui-datatable .ui-datatable-data-empty td {
color: red;
font-weight: bold;
}

.ui-datatable.mystyle th {
background: EAAB00;
font-family: verdana;
font-size: 1em;
}

.mystyle.ui-datatable .ui-expanded-row-content {
background: white;
}

th.foo {
background: #ff8000 !important;
color: white;
}


And my xhtml page looks like:

<!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"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
<h:outputStylesheet library="css" name="style.css" />
</h:head>
<h:body>
<h:form>
<p:dataTable id="dtPrueba" widgetVar="dtPrueba" rows="3"
value="#{controlador.datos}" var="d" styleClass="mystyle"
style="border-collapse:collapse;width:800px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">
<h:outputText value="Documentos adicionales" style="color:white;" />
</f:facet>
<p:column styleClass="foo"
style="width:5px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">N°</f:facet>
<h:outputText value="#{d.id}" style="color:White;" />
</p:column>
<p:column styleClass="foo"
style="width:700px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">Documento</f:facet>
<h:outputText value="#{d.id}" style="color:White;" />
</p:column>
<p:column styleClass="foo"
style="width:30px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">N° Documentos</f:facet>
<h:outputText value="#{d.id}" style="color:White;" />
</p:column>
<p:column styleClass="foo"
style="width:30px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">Asesor</f:facet>
<h:outputText value="#{d.id}" style="color:White;" />
</p:column>
<p:column styleClass="foo"
style="width:30px;border-style:solid;border-color:Black;border-width:thin;">
<f:facet name="header">Visador</f:facet>
<h:outputText value="#{d.id}" style="color:White;" />
</p:column>
</p:dataTable>
</h:form>
</h:body>
</html>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests