0

A question about writing HTML code.

I have two pieces of code. I want to write the table data from code one into code two while retaining the style of code two. How should I write the code?Their structures are different, I need to learn.

Thank you for your help.

Code one👇

let Table := (select 'table');
let JRXX := " Code one ";
let css := "<style></style>";
let hf := ---
        <tr>
        <ttt style="color: rgb(65,105,251);  padding: .2em .2em; font-size: 1.2em; font-weight: bold;"> { JRXX } </ttt>
        </tr>
    ---;
let thead := ---
    <thead>
        <tr>
            <th style="white-space: nowrap;"> Data one </th>
            <th style="white-space: nowrap;"> Data two </th>
            <th style="white-space: nowrap;"> Data there </th>
            <th style="white-space: nowrap;"> Data four </th>
        </tr>
    </thead>
    ---;
let tbody := Table.---
        <tr onclick=ui.popupRecord('{ 'Id' }')>
            <td style="text-align:center; font-weight: bold; font-size: 0.9em; line-height: 1.2;"> { format('采购订单'.'采购日期', "YYYY/MM/DD") } </td>
            <td style="text-align:center; font-weight: bold; font-size: 0.9em; line-height: 1.2;"> { '数量' }{ '程式' } </td>
            <td style = "text-align:center; white-space: nowrap;"> { '采购订单'.'收货人'.'姓名' } </td>
            <td style="text-align: center; white-space: nowrap;"> { '采购订单'.'入库仓库'.'仓库名称' } </td>
        </tr>
    ---;
let tfoot := ---
    <tfoot>
        <tr>
            <th colspan='2' style="text-align:center; white-space: nowrap;">合计 { sum(number(extractx(text(Table.'数量(零)'), "\d+"))) } { unique(Table.'产品'.'产品规格'.'子单位名') }</th>
            <th colspan='2' style="text-align:center; white-space: nowrap;">合计 { cnt(Table) } 条记录</th>
        </tr>
    </tfoot>
    ---;
html(---
 <aside class='tableFixHead'>{ css }{ hf }<table>{ thead }{ tbody }{ tfoot }</table></aside>
---)

 

Code two👇

html("<body>
    <div class='bootstrap5'>
<table class='table'>
  <thead class='table-dark'>
    <tr>
      <th scope='col'>#</th>
      <th scope='col'>First</th>
      <th scope='col'>Last</th>
      <th scope='col'>Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope='row'>1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope='row'>2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope='row'>3</th>
      <td colspan='2'>Larry the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
    </div>
  </body>")

Reply

null

Content aside

  • 5 mths agoLast active
  • 55Views
  • 1 Following