IE 10 Missing border segments while printing table elements
Date : March 29 2020, 07:55 AM
help you fix your problem I came across a similar issue in IE 9. The top half of the border on the first row of the first table on a page would not appear on the paper version of the page. When I load your code I see the same symptom. I worked around our problem by combining the border rules for the table, th, and td into a single rule. The trick appears to work for yours as well, but it means the outer border will be the same size as the inner border: table {
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
|
td border , border-bottom is not printing in pdf by using itext library
Tag : java , By : mikhaelrasputin
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Allow me to reuse the code from iTextSharp add ( css style or a css file) and download pdf file and slightly change some values: public static final String CSS = "th { border-top: 5px solid green; } "
+ "td { font-size: 10pt; border-color: gray; border: 3px}";
public static final String HTML = "<html><body><table class='table-bordered'>"
+ "<thead><tr><th>Customer Name</th><th>Customer's Address</th> </tr></thead>"
+ "<tbody><tr><td> XYZ </td><td> Bhubaneswar </td></tr>"
+ "<tr><td> MNP </td><td> Cuttack </td></tr></tbody>"
+ "</table></body></html>";
/**
* @param file
* @throws IOException
* @throws DocumentException
*/
public void createPdf(String file) throws IOException, DocumentException {
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
CSSResolver cssResolver = new StyleAttrCSSResolver();
CssFile cssFile = XMLWorkerHelper.getCSS(new ByteArrayInputStream(CSS.getBytes()));
cssResolver.addCss(cssFile);
// HTML
HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);
htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory());
// Pipelines
PdfWriterPipeline pdf = new PdfWriterPipeline(document, writer);
HtmlPipeline html = new HtmlPipeline(htmlContext, pdf);
CssResolverPipeline css = new CssResolverPipeline(cssResolver, html);
// XML Worker
XMLWorker worker = new XMLWorker(css, true);
XMLParser p = new XMLParser(worker);
p.parse(new ByteArrayInputStream(HTML.getBytes()));
document.close();
}
|
How to give corner of table cell border the color of top/bottom border instead of the left/right border
Date : March 29 2020, 07:55 AM
this will help You can get them with a pseudo element, which will be the size of the whole row + borders. Then reapply only top and bottom border. table {
border-collapse: collapse;
text-align: center;
}
table tr td {
border: 8px solid grey;
border-top: none;
}
table tr:first-child {
border: 8px solid black;
}
table tr th:not(:last-child) {
border-right: 8px solid red;
}
table tr th {
position: relative;
}
table tr th::before {
content: "";
position: absolute;
top: -8px; left: -8px;
width: calc(100% + 16px); height: 100%;
border-width: 8px 0;
border-color: black transparent;
border-style: solid;
}
I want:
<table>
<tr>
<th> black-bordered </th>
<th> row </th>
<th> separated </th>
<th> with </th>
<th> reds </th>
</tr>
<tr>
<td> everything </td>
<td> below </td>
<td> it </td>
<td> simply </td>
<td> grey </td>
</tr>
</table>
|
How can I place a border-bottom on the last visible row of a table with border-collapse=separate?
Date : March 29 2020, 07:55 AM
wish help you to fix your issue If you can change the HTML when the becomes visible or invisible, I think the most straightforward way is to put it in a whenever it's invisible. Then you can keep the border around the the tbody (or rather, around the cells in the tbody) and make the tfoot invisible.table, tbody, thead, tfoot, tr {
border-collapse: separate; border-spacing: 0; border-radius: .5em;
}
tbody tr:first-child td {border-top: 2px outset #777;}
tbody tr:last-child td {border-bottom: 2px outset #777;}
tbody td:first-child {border-left: 2px outset #777;}
tbody td:last-child {border-right: 2px outset #777;}
tbody tr:first-child td:first-child {border-top-left-radius: 0.5em;}
tbody tr:first-child td:last-child {border-top-right-radius: 0.5em;}
tbody tr:last-child td:first-child {border-bottom-left-radius: 0.5em;}
tbody tr:last-child td:last-child {border-bottom-right-radius: 0.5em;}
.invisible {visibility: collapse; display: none;}
<table>
<caption>This is the table:</caption>
<tbody>
<tr>
<td>this is visible.</td>
<td>this is visible.</td>
</tr>
<tr>
<td>this is visible.</td>
<td>this is visible.</td>
</tr>
</tbody>
<tfoot class="invisible">
<tr>
<td colspan="3">this is not.</td>
</tr>
</tfoot>
</table>
How would I remove those small gaps on the bottom and right side of the navbar elements?
Date : March 29 2020, 07:55 AM
I wish this helpful for you I'm trying to remove those small gaps between my nav-link elements and navbar on the bottom as well as on the right side, but can't seem to figure out. I tried setting min-height: 0 and changing it to display: flex and tweaking the justify-content and align-items properties, but didn't achieve the desired outcome. How else could I make it work? , Replace this css #navbar {
font-size: 1.4em;
width: 50%;
text-align: right;
background-color: orange;
/* padding: 10px 0px 10px 0px; */
display: flex;
justify-content: flex-end;
|
|