Я работаю с Laravel и DOMPDF для генерации PDF. Ниже приведен мой код для генерации PDF. Я сообщаю о отображении разных в разных браузерах. Когда я генерирую PDF, он работает нормально, но получаю проблемы в части CSS. < /P>
@page {
margin: 25mm 20mm;
}
body {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
font-size: 12pt;
color: #2c3e50;
}
#tblContainer {
margin: 0 auto;
padding: 10mm 10mm;
box-sizing: border-box;
width: 100%;
}
tr, tbody {
page-break-inside: avoid !important;
break-inside: avoid !important;
}
.agency-table-wrapper {
page-break-inside: avoid !important;
}
.content-wrapper {
width: 100%;
/* No margin or padding needed here for spacing */
}
.report-header {
margin-top: 0; /* avoid margin-top on first element */
padding-top: 10px; /* padding works better with Dompdf */
}
.report-header span {
font-size: 18pt;
font-weight: bold;
text-transform: uppercase;
color: #34495e;
}
.meta-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 25px;
}
.meta-table td {
padding: 8px 10px;
border: 1px solid #ccc;
font-size: 12pt;
}
.page-break {
page-break-before: always;
display: block;
height: 1px;
}
.agency-header {
font-size: 16pt;
font-weight: bold;
color: #2980b9;
margin-bottom: 15px;
margin-top: 25px;
border-left: 6px solid #3498db;
padding-left: 12px;
}
table.agency-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
margin-bottom: 30px;
}
.agency-table th,
.agency-table td {
border: 1px solid #bdc3c7;
padding: 8px 12px;
text-align: center;
vertical-align: top;
}
.agency-table th {
background-color: #ecf0f1;
font-weight: bold;
color: #2c3e50;
}
.agency-table td.total-cell {
background-color: #f8f9fa;
font-weight: bold;
color: #000;
}
.adjustment-table {
font-size: 10pt;
}
@media print {
.metadata-section {
margin-top: 60px;
}
}
.metadata-section {
margin-top: 40mm;
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... page-break
TR TAG разделен на два, пока перерыв страницы ⇐ Php
Кемеровские программисты php общаются здесь
-
Anonymous
1748473290
Anonymous
Я работаю с Laravel и DOMPDF для генерации PDF. Ниже приведен мой код для генерации PDF. Я сообщаю о отображении разных в разных браузерах. Когда я генерирую PDF, он работает нормально, но получаю проблемы в части CSS. < /P>
@page {
margin: 25mm 20mm;
}
body {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
font-size: 12pt;
color: #2c3e50;
}
#tblContainer {
margin: 0 auto;
padding: 10mm 10mm;
box-sizing: border-box;
width: 100%;
}
tr, tbody {
page-break-inside: avoid !important;
break-inside: avoid !important;
}
.agency-table-wrapper {
page-break-inside: avoid !important;
}
.content-wrapper {
width: 100%;
/* No margin or padding needed here for spacing */
}
.report-header {
margin-top: 0; /* avoid margin-top on first element */
padding-top: 10px; /* padding works better with Dompdf */
}
.report-header span {
font-size: 18pt;
font-weight: bold;
text-transform: uppercase;
color: #34495e;
}
.meta-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 25px;
}
.meta-table td {
padding: 8px 10px;
border: 1px solid #ccc;
font-size: 12pt;
}
.page-break {
page-break-before: always;
display: block;
height: 1px;
}
.agency-header {
font-size: 16pt;
font-weight: bold;
color: #2980b9;
margin-bottom: 15px;
margin-top: 25px;
border-left: 6px solid #3498db;
padding-left: 12px;
}
table.agency-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
margin-bottom: 30px;
}
.agency-table th,
.agency-table td {
border: 1px solid #bdc3c7;
padding: 8px 12px;
text-align: center;
vertical-align: top;
}
.agency-table th {
background-color: #ecf0f1;
font-weight: bold;
color: #2c3e50;
}
.agency-table td.total-cell {
background-color: #f8f9fa;
font-weight: bold;
color: #000;
}
.adjustment-table {
font-size: 10pt;
}
@media print {
.metadata-section {
margin-top: 60px;
}
}
.metadata-section {
margin-top: 40mm;
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79643102/tr-tag-split-in-two-while-page-break[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия