Jump to content
  • 0

Responsive Blocks


jhanajc

Question

Hi all,

 

I have a requirement to arrange fields within a Details datapage into 3 horizontal responsive blocks with captions.

 

I have used the responsive code from the Caspio tech tip and added my own markup in the datapage header.

 

The result when deployed is ok - 3 responsive blocks with shadow borders. 

 

However if I insert the same code in HTML Blocks (1 table per block) in a 3 column section, the spacing is different and I lose the nice responsiveness.

 

How can make it work in HTML Blocks?

 

html below.

 

Thanks!

 

Jon (novice at all things web codey)

 

<h3>Vehicle Details</h3>
<table style="max-width: 583px; height: 202px; margin: 10px 10px; float: left; table-layout:fixed; box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);">
<caption>Summary</caption>
  <tr>
     <td style="border: 0px solid black; padding-left:8px">
     <h4 style="background-color:#fbbc01;width:120px;padding:3px;border:1px solid black;text-align:center;">[@field:Vehicle_Assets_Reg_Mark]</h4></td>
     <td rowspan="5" style="padding:8px; border: 0px solid black;">
     <img src=[@field:Vehicle_Thumbs_Lookup_Image/] alt="logo" border=3 width=100% /></td>
  </tr>
  <tr>
     <th style="border: 0px solid black; padding-left:8px; color:#666666;">Type</th>
  </tr>
  <tr>
      <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Thumbs_Lookup_Type]</td>
  </tr>
  <tr>
 <th style="border: 0px solid black;padding-left:8px;color:#666666;">Variant</th>
  </tr>
  <tr>
      <td style="border: 0px solid black;padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Thumbs_Lookup_Variation]</td>
  </tr>
</table>
<table style="max-width: 583px; height: 202px; margin: 10px 10px; float: left; table-layout:fixed; box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);">
<caption>Manufacturer / Axle Configuration</caption>
  <tr>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Make</th>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Wheel Plan</th>
  </tr>
  <tr>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Make]</td>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Thumbs_Lookup_Wheel_Plan]</td>
  </tr>
  <tr>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Model</th>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Axle Config</th>
  </tr>
  <tr>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Model]</td>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Axle_Configuration]</td>
  </tr>
  <tr>
<th style="border: 0px solid black;padding-left:8px; padding-top:8px; color:#666666;">Maintenance Provider</th>
     <th style="border: 0px solid black;padding-left:8px; padding-top:8px; color:#666666;">Lift Axle</th>
  </tr>
  <tr>
     <td style="border: 0px solid black;padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Maintenance_Provider]</td>
     <td style="border: 0px solid black;padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Lift_Axle_Configuration]</td>
  </tr>
</table>
<table style="max-width: 583px; height: 202px; margin: 10px 10px; float: left; table-layout:fixed; box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);">
<caption>Fleet Information</caption>
  <tr>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Short Name</th>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Operating Center</th>
  </tr>
  <tr>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Short_Name]</td>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Operating_Center]</td>
  </tr>
  <tr>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">Fleet No.</th>
     <th style="border: 0px solid black; padding-left:8px; padding-top:8px; color:#666666;">blank</th>
  </tr>
  <tr>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Fleet_No]</td>
     <td style="border: 0px solid black; padding-left:8px; padding-bottom:8px;">blank</td>
  </tr>
  <tr>
<th style="border: 0px solid black;padding-left:8px; padding-top:8px;">Status</th>
     <th style="border: 0px solid black;padding-left:8px; padding-top:8px;">blank</th>
  </tr>
  <tr>
     <td style="border: 0px solid black;padding-left:8px; padding-bottom:8px;">[@field:Vehicle_Assets_Status]</td>
     <td style="border: 0px solid black;padding-left:8px; padding-bottom:8px;">blank</td>
  </tr>
</table>
 
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Further digging reveals that the problem is related to the code resulting in a <table> within a <table>.

 

Within the datapage, if I set the Section columns to 3 and add three HTML Blocks each formatted with the following code (table formats constructed from <DIV>s), it works much better although it might not be the best way to go..

 

Please let me know if you have any other techniques to share! Thanks. Jon.

 

TABLE CONSTRUCTED FROM DIV TAGS:

 

<div style="max-width: 583px; min-width: 583px; height: 202px; margin: 5px 5px; display:table; box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);">
    <div style="display: table-caption;">
        <p>This is a Table</p>
    </div>
    <div style="display: table-row;">
        <div style="display: table-cell;">
            <p>Heading 1</p>
        </div>
        <div style="display: table-cell;">
            <p>Heading 2</p>
        </div>
        <div style="display: table-cell;">
            <p>Heading 3</p>
        </div>
    </div>
    <div style="display: table-row;">
        <div style="display: table-cell;">
            <p>Row 1 Column 1</p>
        </div>
        <div style="display: table-cell;">
            <p>Row 1 Column 2</p>
        </div>
        <div style="display: table-cell;">
            <p>Row 1 Column 3</p>
        </div>
    </div>
    <div style="display: table-row;">
        <div style="display: table-cell;">
            <p>Row 2 Column 1</p>
        </div>
        <div style="display: table-cell;">
            <p>Row 2 Column 2</p>
        </div>
        <div style="display: table-cell;">
            <p>Row 2 Column 3</p>
        </div>
    </div>
</div>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...