Change the look of your forms

Tips submitted by PHPMaker users
Post Reply
vintoICT
User
Posts: 389

Change the look of your forms

Post by vintoICT »

I just tried this and its really cool. It will change the look of your forms

go to server events , page datarendering for the table, (for Add page ,go to Add/Copy Page >>Page_DataRendering)
edit header to

<style>
.center {
   margin: auto;
   width: 70%;
  padding: 10px;
  background-color:#F8F9FA;
 }
 @media (max-width: 767px) {
    .center{
       width: 100%;
         margin-left:-2px;
    }
 }
 
 </style>
 </header>

 <div class="container-xxl  center">

NOTE to avoid php errror, change to single string.

$header = "" must be changed to $header = ' '

Your final code must look like this

// Page Data Rendering event
function Page_DataRendering(&$header)
{
    // Example:
    $header = '
<style>.center {
   margin: auto;
   width: 70%;
  padding: 10px;
  background-color:#F8F9FA;
 }
 @media (max-width: 767px) {
    .center{
       width: 100%;
         margin-left:-2px;
    }
 }
 
 </style>
 </header>

 <div class="container-xxl  center">';
}

You can tweak the style to your taste . Enjoy.


mobhar
User
Posts: 11660

Post by mobhar »

Nice try. Just some suggestions:

  1. You should remove the </header> part from your code.
  2. You should add the closing </div> tag in Page_DataRendered server event since you have the open <div ...> tag in Page_DataRendering server event:
    $footer = '</div>';

vintoICT
User
Posts: 389

Post by vintoICT »

Absolutly . Thanks for the update .


Post Reply