Author Topic: Forecast Discussion Synopsis too wide  (Read 369 times)

0 Members and 1 Guest are viewing this topic.

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Forecast Discussion Synopsis too wide
« on: June 01, 2018, 06:28:04 AM »
I've trying to figure out why the Forecast Discussion is overrunning the table size I've asked it to use.

I have (I think) it set to max out in a 600px wide table. But sometimes it filled almost the entire screen width.
A fix for that?

Here's the code:

Code: [Select]
<table border="1" cellspacing="0" cellpadding="0" style="width:600px; margin: 0px auto 0px auto;">
  <tr>
<td style="color: #000000; background-color: #FFFF00; text-align: center"><font color="black" font-size= "16px"><strong>CENTRAL NEW YORK FORECAST DISCUSSION SYNOPSIS</strong></font>
<?php include ("forecast-discussion-synopsis.php"); ?>
</td>
</tr>
</table>

Thanks.

Tony




Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Forecast Discussion Synopsis too wide
« Reply #1 on: June 01, 2018, 11:31:03 AM »
I've trying to figure out why the Forecast Discussion is overrunning the table size I've asked it to use.

I have (I think) it set to max out in a 600px wide table. But sometimes it filled almost the entire screen width.
A fix for that?

Here's the code:

Code: [Select]
<table border="1" cellspacing="0" cellpadding="0" style="width:600px; margin: 0px auto 0px auto;">
  <tr>
<td style="color: #000000; background-color: #FFFF00; text-align: center"><font color="black" font-size= "16px"><strong>CENTRAL NEW YORK FORECAST DISCUSSION SYNOPSIS</strong></font>
<?php include ("forecast-discussion-synopsis.php"); ?>
</td>
</tr>
</table>

Thanks.
The block is to wide when there is a lot of text / or very long lines.
The script which generates  and displays the text-block is forecast-discussion-synopsis.php
These are the lines which display the block
Code: [Select]
  print "<pre>\n";
  print htmlspecialchars(strip_tags($discussion));
  print "</pre>\n";  $niceFileName = preg_replace('!&!is','&amp;',$fileName);
You should remove the < pre >   < / pre > parts so that it looks like these lines
Code: [Select]
 
  print htmlspecialchars(strip_tags($discussion));
    $niceFileName = preg_replace('!&!is','&amp;',$fileName);
Now the long text lines will wrap and not extend outside the box.

Wim

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: Forecast Discussion Synopsis too wide
« Reply #2 on: June 01, 2018, 12:41:04 PM »
That did it Wim.

THANK YOU VERY MUCH!
Tony