dotnet / dotnet/docfx

custom css is not applied for downloaded pdf

Open
#10,197 0 comments 0 reactions 0 assignees View on GitHub
pdf
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**Describe the bug**
We have custom css for "@media print" in normal style and case.
-------------------------------------------------
/* custom-table-style.css */
@media print {
.custom-table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}

.custom-table th,
.custom-table td {
word-wrap: break-word;
overflow: hidden;
border: 1px solid #D3d3d3;
padding: 5px; /* Adjust padding as needed */
}
}
-----------------------------------------------------------
.custom-table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}

.custom-table th,
.custom-table td {
word-wrap: break-word;
overflow: hidden;
border: 1px solid #D3d3d3;
padding: 5px; /* Adjust padding as needed
---------------------------------------------------------------
Style is being applied for docfx site. But it is not getting applied for the downloaded pdf.

**To Reproduce**
Steps to reproduce the behavior:
1. Create custom css as mentioned above for a page having table and try to generate PDF.

**Expected behavior**
Both docfx website and PDF should show similiar table styles.

**Context (please complete the following information):**
- OS: Windows
- Docfx version: [e.g. 2.77.0]

**Actual behaviour**
Website shows correct css style but downloaded pdf is showing theme style itseems..

**Additional context**
If we try to print - custom style is reflected.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.