I am printing a panel with this information primefaces button.
But I need to send this impression with a smaller font, how do I do that in this code?
<p:commandButton value="Imprimir" styleClass="btn btn-primary" >
<p:printer target="information" />
</p:commandButton>
This is my component information I want to print:
In printing occupies an entire sheet and I want to reduce the font when printing call
<p:panel id="information">
<h3 class="text-warning">#{msg['text-warning']}</h3>
<p>#{msg['text-valueReference']}</p>
<p class="lead text-primary">#{msg['text-time']}*</p>
<p>
<strong>#{msg['lbl-band1']}:</strong>#{' '}#{msg['text-band1']}
</p>
<p>
<strong>#{msg['lbl-band2']}:</strong>#{' '}#{msg['text-band2']}
</p>
<p>
<small> #{msg['text-leiBand']} </small>
</p>
<p class="lead text-primary">#{msg['text-Baggage']}</p>
<p>
<strong>De mão:</strong>#{' '}#{msg['text-HandLuggage']}
</p>
<p>
<strong>Normal:</strong>#{' '}#{msg['text-NormalBaggage']}
</p>
<blockquote>
<p>#{msg['text-noCharge']}</p>
<small> #{msg['text-noChargeVolumes']} </small>
</blockquote>
<blockquote>
<p>#{msg['text-Charge']}:</p>
<small> #{msg['text-ChargeVolumes']} </small>
</blockquote>
<p>
<small> #{msg['text-leiVolumes']} </small>
</p>
<p class="lead text-primary">#{msg['text-optionalTransport']}</p>
<p>
<strong></strong>#{msg['text-optionalTransportValue']}
</p>
<p>
<strong> </strong>
</p>
<blockquote>
<p>#{msg['text-animals']}:</p>
<small> #{msg['text-animalsValues']} </small>
</blockquote>
<blockquote>
<p>#{msg['text-large-bags']}:</p>
<small> #{msg['text-largeBagsValue']} </small>
</blockquote>
<p>
<small> #{msg['text-obs']} </small>
</p>
</p:panel>
Related
How browser shows "my" code
<html>
<head>
<title> chatter|app </title>
<style>
.styled_dates {
font-size: 11px;
}
</style>
</head>>
<body>
<h1> chatter|app </h1>
<h2> Favorites </h2>
<p> <strong>Neversea</strong> <p class="styled_dates"> 11/07/2022 </p>
<p> <strong>Deutschland</strong> <p class="styled_dates"> 23/05/2019 </p>
<p> <strong>Erasmus</strong> <p class="styled_dates"> 23/06/1999 </p>
<p> <strong>Work</strong> <p class="styled_dates"> 04/07/2003 </p>
<h2> Regular </h2>>
</body>
</html>
Hello. Noobie here.
What I want to do: see the dates next to "Neversea, Deutschland, Erasmus, Work", not underneath them.
Neversea 11 07/2022
not...
Neversea
11/07/2022
How can I do that?
Thank you
The issue is that <p> tags by default follow onto the next line. Also you have unclosed tags (each line you open 2 and only close 1)
In my code I use <span> elements, they are made for in-line styling/changes which seems appropriate for your use case.
.styled_dates {
font-size: 11px;
}
<h1> chatter|app </h1>
<h2> Favorites </h2>
<p>
<strong>Neversea</strong>
<span class="styled_dates">11/07/2022</span>
</p>
<p>
<strong>Deutschland</strong>
<span class="styled_dates">23/05/2019</span>
</p>
<p>
<strong>Erasmus</strong>
<span class="styled_dates">23/06/1999</span>
</p>
<p>
<strong>Work</strong>
<span class="styled_dates">04/07/2003</span>
</p>
<h2> Regular </h2>
So Ive created a table to divide the html text into 2 languages English/Spanish, but for some reason which I can not understand, the text is starting just below for the second column... Like this:
Maybe I am missing an atribute? Or some justification?
<table width="863">
<tr>
<td width="428">
<p>
<strong>AVISO DE PRIVACIDAD</strong>
</p>
<p>
<strong>ESTUDIANES Y PADRES DE FAMILIA</strong>
</p>
<p> <strong>Identidad y domicilio del Responsable:</strong>
</p>
<p>TEXT TEXT TEXT.</p>
<p> <strong>TEXT TEXT:</strong>
</p>
<p>TEXT TEXT TEXT</p>
<p>....</p>
</td>
<td width="435">
<p>
<strong>PRIVACY NOTICE</strong>
</p>
<p>
<strong>STUDENTS AND PARENTS</strong>
</p>
<p> <strong>Identity and address of the Responsible Party:</strong>
</p>
<p>TEXT TEXT TEXT TEXT</p>
<p> <strong>Categories of the data treated by the School:</strong>
</p>
<p>TEXT TEXT TEXT</p>
<p> a) <u>TEXT TEXT
</td>
</tr>
</table>
Your code is absolutely fine as there is no margin or padding. It could be because of
the editor you are using
some css file which is messing with body/table/p/... tags
Thanks for your answers! I just found a "forced" solution. Just added valign="top" into the td as an atribute.
I'm having trouble trying to push the containers inside my two columns layout. Right now it aligns which means that there are gaps between a container if it happens to be longer than other containers.
Here is the picture that hopefully explains it further
Below is the code of this part:
<section class="maincontent container container-fluid">
<!-- BOX 1 -->
<article class="servicestatus container container-fluid col-xs-12 col-md-6 float-md-left">
<a id="aservicestatus"></a>
<div class="container">
<span class="sprite icon"></span>
<h3>Service Status Notifications</h3>
<j:while test="${ou.next()}">
<j:if test="${ou.type!='planned'}">
<div class="statusitem">
<j:if test="${ou.type=='outage'}">
<span class="status red">Outage</span>
</j:if>
<j:if test="${ou.type=='degradation'}">
<span class="status yellow">Degradation</span>
</j:if>
<j:if test="${ou.type=='informational'}">
<span class="status green">Informational</span>
</j:if>
<h5>${ou.short_description}</h5>
<p class="subheader"><strong>Start Date</strong> <em>- ${ou.begin.getDisplayValue()}</em></p>
<p class="subheader">${ou.u_outage_details}</p>
</div>
</j:if>
</j:while>
</div>
</article>
<!-- BOX 2 -->
<article class="plannedoutages container container-fluid col-xs-12 col-md-6 float-md-right">
<a id="aplannedoutages"></a>
<div class="container">
<span class="sprite icon"></span>
<h3>Scheduled Maintenance</h3>
<j:while test="${mn.next()}">
<j:if test="${mn.type=='planned'}">
<div class="outageitem">
<p class="subheader"><strong>${mn.cmdb_ci.name}</strong></p>
<p class="subheader">From: <em>${mn.begin.getDisplayValue()} - ${mn.end.getDisplayValue()} </em> </p>
<p class="subheader">${mn.u_outage_details}</p>
</div>
</j:if>
</j:while>
</div>
</article>
<article class="wifi container container-fluid col-xs-12 col-md-6 pull-md-right">
<a id="awifi"></a>
<div class="container">
<span class="sprite icon"></span>
<h3>Wifi Information</h3>
<div class="container">
<j:if test="${bt.next() || bt.getRowCount() > 0}">
<j:if test="${bt.u_omers_company=='oxford'}">
<p class="subheader">Please follow these Instructions</p>
</j:if>
<j:if test="${bt.u_omers_company!='oxford'}">
<p class="subheader">Please follow these Instructions</p>
</j:if>
</j:if>
</div>
</div>
</article>
<!-- BOX 3 -->
<article class="windows10 container container-fluid col-xs-12 col-md-6 pull-md-right">
<a id="awindows10"></a>
<div class="container">
<!--<span class="sprite icon"></span> -->
<img src="win10icon.png" width="62" height="63"/>
<h3>Exchange/Win 10 Information</h3>
<div class="container">
<p class="subheader">IT Team is pleased to announce the deployment of Windows 10 with Office Professional Plus and Outlook Exchange Online (part of the Microsoft Office 365 platform). You can get regular updates here.</p>
<p></p>
<!--<p class="subheader">For those who would like to preview it prior to receiving the Windows 10 upgrade, please click here.</p> -->
<p class="subheader">We are pleased to inform you that your Office suite has been updated to a new version (1808).</p>
<p class="subheader">This will enable new collaboration features like <B>Document collaboration and co-authoring, AutoSave for Teams and OneDrive files, Improved cell and formula bar editing</B>, etc.</p>
<p></p>
<p class="subheader">To ensure your upgrade is complete:</p>
<p class="subheader">1. <B>Close</B> all open Microsoft apps. </p>
<p class="subheader">2. <B> Relaunch</B> any Microsoft Office desktop app (e.g. Word, PowerPoint, Excel, Outlook) </p>
<p class="subheader">3. <B> Check</B> that you have the right version. Go to <B>File > Account</B>, and look under Product Information for <B>"Version 1808"</B> </p>
<p></p>
<p class="subheader">Please see full release notes here.</p>
</div>
</div>
</article>
<!-- BOX 4 -->
<article class="hoursofoperation container container-fluid col-xs-12 col-md-6 float-md-right">
<a id="ahoursofoperation"></a>
<div class="container">
<span class="sprite icon"></span>
<h3>Hours of Operation</h3>
<j:if test="${be.next()}">
<j:if test="${be.u_omers_company=='oxford'}">
<p class="subheader"><B>Regular Operating Hours: </B> <em>Monday to Friday – 8AM to 8PM ET</em></p>
<p class="subheader"><B>After-Hours Emergency Support: </B> <em>Monday to Friday – 8PM to 11PM ET Saturday to Sunday – 10AM to 7PM ET</em></p>
<p class="subheader"><B>Telephone: </B> <em>416-865-8349</em></p>
<p class="subheader"><B>Email:</B> Service Desk</p>
</j:if>
<j:if test="${be.u_omers_company=='omers'}">
<p class="subheader"><B>Regular Operating Hours: </B> <em>Monday – Friday 7am to 7pm ET</em></p>
<p class="subheader"><B>24/7 on call support: </B> <em>available outside of business hours (by phone only). For urgent issues requiring immediate attention, please call the Service Desk instead of emailing. Depending on volumes being handled by the team, it may take up to 24 business hours for the Service Desk to respond to emails. Outside of normal business hours, the Service Desk phone line is automatically redirected to 24/7 on call support.</em></p>
<p class="subheader"><B>Telephone: </B> <em>416-814-6555, option 1 </em></p>
<p class="subheader"><B>Email:</B> Service Desk</p>
</j:if>
</j:if>
</div>
</article>
<!-- BOX 5 -->
<article class="ITsupport container container-fluid col-xs-12 col-md-6">
<a id="ITsupport"></a>
<div class="container">
<img src="/Facility_logoMobile.png" height="45px"/>
<h3>Facilities Portal</h3>
<p class="content"> From here you can submit a request relating to new office furniture, security cards, confidential shredding services or to request an ergonomic consultation.</p>
Go >
</div>
</article>
</section>
It seems that I have no missing DIVs or at least I see it. It seems to be off and overlap Any suggestions? I am unable to see the problems. The top and bottom one works well but the one with the Build Release notes and Supplemental Release Notes are off quite a bit.
<h2 class="Billboard">
System Knowledge Base</h2>
<div class="Billboard">
<p align="center">
Home I Customer Care
I Field Customer Care
I Logout
</p>
</div>
<h2 class="Billboard">
General System Information</h2>
<div class="Billboard">
<p>
80 Links and Documents
</p>
</div>
**<h2 class="QuickLinks">
Build Release Notes</h2>
<div class="QuickLinks">
<p>
120 Links and Documents
</p>
</div>
</div>
<h2 class="QuickLinks">
Supplemental Release Notes</h2>
<div style="float:right">
<p>
10 Link and Documents
</p>
</div>**
<h2 class="Billboard">
TFACTS Customer Care</h2>
<div class="Billboard">
<p>
10 Link and Documents
</p>
</div>
<h2 class="Billboard">
Reference Materials and Storyboards
</h2>
<div class="Billboard">
<p>
250 Links and documents
</p>
</div>
<!-- InstanceEndEditable -->
</div>
<!-- CLOSES THE MAIN CONTENT DIV -->
You do in fact close a <DIV> prematurely. See the line below that I've commented out.
<h2 class="Billboard">
System Knowledge Base</h2>
<div class="Billboard">
<p align="center">
Home I Customer Care
I Field Customer Care
I Logout
</p>
</div>
<h2 class="Billboard">
General System Information</h2>
<div class="Billboard">
<p>
80 Links and Documents
</p>
</div>
**<h2 class="QuickLinks">
Build Release Notes</h2>
<div class="QuickLinks">
<p>
120 Links and Documents
</p>
<!--- ** </div> RIGHT HERE ** --->
</div>
<h2 class="QuickLinks">
Supplemental Release Notes</h2>
<div style="float:right">
<p>
10 Link and Documents
</p>
</div>**
<h2 class="Billboard">
TFACTS Customer Care</h2>
<div class="Billboard">
<p>
10 Link and Documents
</p>
</div>
<h2 class="Billboard">
Reference Materials and Storyboards
</h2>
<div class="Billboard">
<p>
250 Links and documents
</p>
</div>
<!-- InstanceEndEditable -->
</div>
<!-- CLOSES THE MAIN CONTENT DIV -->
Looks like you have an extra closing div tag. I am going to mark this question on hold because it is too localized. Please use the W3C Validator for things like this: http://validator.w3.org/check
See the closed div tag below marked with a comment:
<h2 class="Billboard">
System Knowledge Base</h2>
<div class="Billboard">
<p align="center">
Home I Customer Care
I Field Customer Care
I Logout
</p>
</div>
<h2 class="Billboard">
General System Information</h2>
<div class="Billboard">
<p>
80 Links and Documents
</p>
</div>
**<h2 class="QuickLinks">
Build Release Notes</h2>
<div class="QuickLinks">
<p>
120 Links and Documents
</p>
</div> <!-- EXTRA CLOSING TAG IS HERE -->
</div>
<h2 class="QuickLinks">
Supplemental Release Notes</h2>
<div style="float:right">
<p>
10 Link and Documents
</p>
</div>**
<h2 class="Billboard">
TFACTS Customer Care</h2>
<div class="Billboard">
<p>
10 Link and Documents
</p>
</div>
<h2 class="Billboard">
Reference Materials and Storyboards
</h2>
<div class="Billboard">
<p>
250 Links and documents
</p>
</div>
<!-- InstanceEndEditable -->
</div>
<!-- CLOSES THE MAIN CONTENT DIV -->
<p>
<p>
<h2>
<p>
<ul>
<p>and two special regions:</p>
<ul>
<h2>
<span class="editsection">
<span id="History" class="mw-headline">History</span>
</h2>
<div class="thumb tleft">
<p>
<p>
<h3>
<p>
<div class="thumb tright">
<div class="thumb tright">
<p>
<p>
<h3>
<p>
<h3>
<div class="thumb tright">
<p>
<p>
<p>
<p>
<p>
<p>
<h3>
<p>
<h2>
<span class="editsection">
<span id="Demography" class="mw-headline">Demography</span>
</h2>
<div class="thumb tright">
<p>
<div class="thumb tright">
<p>
<table class="wikitable sortable jquery-tablesorter">
<p>
<p>
<p>
How to count the number of <P> tags in between two <h2> tags?
Start with tag
<h2>
<span class="editsection">
<span id="History" class="mw-headline">History</span>
</h2>
and
<h2>
<span class="editsection">
<span id="Demography" class="mw-headline">Demography</span>
</h2>
the xpath should retreive 13 <p> tags between these two <h2> tag. So how to do write xpath for this?
Note: Tags <p> <h2> <h3> <ul> <div> are siblings.
<p> tags and <h2> tags does't contain any of the attribute.
This one should work for you:
count(//p[preceding-sibling::h2[./span[#id='History']] and following-sibling::h2[./span[#id='Demography']]])
You can test it with the following transformation:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="count(//p[preceding-sibling::h2[./span[#id='History']] and following-sibling::h2[./span[#id='Demography']]])" />
</xsl:template>
</xsl:transform>
Use:
count((//h2)[1]/following::p[count(following::h2[1] | (//h2)[2]) = 1])
XPath operates on XML, not HTML. While it's possible for HTML also be well-formed XML, it certainly isn't in your case.
If you want to use XPath, you'll need to also use a tool that will load it as a valid XML DOM, or converts it to well-formed XML first. Failing that, your only realistic option is to use text processing methods to do this.