Skip to main content
Inspiring
February 6, 2021
Question

Setting font size of table in @media print

  • February 6, 2021
  • 1 reply
  • 922 views

The code for my table begins:

 

<table class="table table-bordered table-sm">

    <tbody>

        <tr>

            <td class="summary_left_col">Difficulty</td>

            <td class="summary_right_col"><strong>3 </strong>Intermediate</td>

        </tr>

 

The font sizes in my table are fine on the screen, but I need to reduce the size for printing. In the CSS for @217338 print I include:

 

.summary_left_col {font-size: 9pt;}
.summary_right_col {font-size: 10pt;}

 

but those statements do not have any affect. I assume that the problem is that the "table-sm" is over-riding.

 

Can you tell me what I should do to adjust the font size?

 

Thank you.

 

Marcus Libkind

 

 

This topic has been closed for replies.

1 reply

Nancy OShea
Community Expert
Community Expert
February 8, 2021

Hi @Marcus1587,

Answers to style questions are contained in your CSS, not fragments of HTML.  So based on what little you've told us, it's impossible to provide meaningful answers.  

 

Upload your problem page and stylesheets

 

<link rel="stylesheet" media="screen" href="main.css" />
<link rel="stylesheet" media="print" href="print.css" />

 

to a remote server you control and post the URL here so we can take a look at them.

 

Nancy O'Shea— Product User & Community Expert
Inspiring
February 14, 2021

Sorry for taking so long to reply. Had to take care of family stuff.

 

Here is the link to a sample webpage for which I want to adjust the font size for the table that begins at Line 66.

https://tours.snowlands.org/tours/03/0312_tour.htm

 

From there you should be able to retrieve the CSS (tour.CSS). The last part of the CSS contains the @217338 print {} query. The three classes that control the fonts used are .des_paragraph, .summary_left_col and .summary_right_col.

 

I originally wrote only about the table not formating as I desire at print time (.summary_left_col and .summary_right_col classes), but now I see that the main part of the printed version, controlled by .des_paragraph, does not format the font correctly either.

 

Any help you can give will be greatly appreciated.

 

Marcus Libkind