can I get column sum in CSS only? im using weasyprint which does not support js/Jq so I have to calculate the sum anyhow and i don't know how will I do it.
table {
border-collapse: collapse;
counter-reset: sum;
}
td[data-value] { counter-increment: sum attr(data-value) }
thead tr::after { content: counter(sum) }
but it always show zero
Related
I am trying to convert my css to less but the online tools are not showing any restructuring. The following snippet is not showing any reduced output.
.tax-included .tax-included-show { display: none;}
I seem to recall that this can be reduced further with operators but I can't get it working.
These did not work as expected
.tax-included {
&-show {
display: none;
}
}
.tax-included {
> &-show {
display: none;
}
}
Basically, I shouldn't need to type 'tax-included' two times.
I have a long table that starts on one page and finishes on another page. The issue is that tr row between these pages does not break, but it stretches. I want the following behavior: If tr can`t fit, the complete row (ALL TR, not a part) should go to the other page
I have tried these but not work for me
/*.tableAdditionalInfo >table{
!*-fs-table-paginate: paginate;
border-collapse: separate;*!
!*page-break-inside: avoid;*!
-fs-table-paginate: paginate;
border-spacing: 0;
}*/
.tableAdditionalInfo > tr {
/* page-break-before: always; */
page-break-after: always
}
You should use:
tr {page-break-inside: avoid}
I use DataTables and would like to reduce the columns a bit.
I use the following code for this.
$('#example').dataTable( {
"columnDefs": [
{ "width": "29px", "targets": 0 }
]
});
When I then check the number of pixels in the developer tools in Chrome, significantly more pixels appear and I still have too much space between the last letter of the column name and the arrow for sorting. See screenshot.
I just want to reduce the space between the last letter of the label and the arrow for sorting the records a bit. Example
I have not tried this solution but maybe it's working. We need to define width of table with this option.
Datatable configutation :
$('#example').dataTable( {
"autoWidth": false
} );
Css :
table {
margin: 0 auto;
width: 100%;
clear: both;
border-collapse: collapse;
table-layout: fixed; // ***********add this
word-wrap:break-word; // ***********and this
}
OR
You can try from this link: https://datatables.net/extensions/fixedcolumns/examples/initialisation/size_fixed.html
My site contain a lot of data like 150 records on page, when I press ctrl+p then it will show the first page only, like only the visible part of the page but I want full [ 150] records.
This is what I tried So far:
<style>
##media print
{
html, body {
height:100%;
margin: 0 !important;
padding: 0 !important;
overflow: auto;
}
#header, #menuheader
{
display: none !important;
}
table { page-break-inside:auto }
tr { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
#prctrow
{
text-align:center !important;
}
}
</style>
This css remove the scrollbar from print preview but data is still not showing.
A few steps to possibly fix this as it's a bit difficult to see the complete issue with only your CSS.
Make sure your actual CSS is using one "#" symbol for "#media print {"
"display: inline-block" might need to be set to "display: block;"
Anything floated may have to be cleared and set to not float
Things positioned absolute or fixed should be set to static
Add something at the bottom of the page to test if everything is blank or just the table on the second page
I am using the following css to show a large amount of table data while printing.
#toolbar.fixed + .content{
overflow: visible;
position: static;
bottom: 0em;
}
table { page-break-after:auto }
tr { page-break-inside:avoid; page-break-after:auto }
td { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
The browser I am using is IE 7. The problem I am facing is that the data on the last row of some of the pages is getting split between the current page and the next page. I am trying to figure out if something is wrong with my css above or if I need to introduce additional css to prevent the last row of data (only on some pages) to stop getting split between two pages.
page-break-inside is still unsupported in many major browsers:
http://www.w3schools.com/cssref/pr_print_pagebi.asp
Also note that page breaks are not permitted inside positioned objects.
Using page-break-before: auto; And page-break-after: auto; may fix this, but you can use this page as a guide to create styles you need without using page-break-inside ...
Use below code.....
`function printControl(){
var table = document.getElementById("DataList1");
var count = table.rows.length;
for (var i = 0; i < count; i++) {
if ((i % 4 == 0)&&(i!=0)) {
table.rows[i].style.cssText = "page-break-after:always";
}
}
}`