【问题标题】:How to add <p> after table? (php / JS / wordpress)如何在表格后添加 <p>? (php/JS/wordpress)
【发布时间】:2021-03-28 06:33:06
【问题描述】:

我想在table后面加上p tage或者换行,这样table和div中的内容可以分两行显示。
目前它们显示在一行中,非常混乱(i.imgur.com/7cnQhou.jpg)。
请告诉我如何使用 php 或 JS 来完成?

<div class="woocommerce-variation">
        <input type="hidden" id="thwepof_product_fields" name="thwepof_product_fields" value="test2">
        <table class="thwepo-extra-options thwepo_variable" cellspacing="0">
               <tbody><tr class=""><td class="label leftside"></td>
                      <td class="value leftside">
                      <input type="text" id="test2" class="thwepof-input-field">
                      </td></tr>
               </tbody>
         </table>
         <div class="quantity">
             <input type="number" id="quantity_60" class="input-text qty" inputmode="numeric">
         </div>
         <button type="submit" class="single_add_to_cart_button">Add to cart</button>
    </div>

谢谢。

【问题讨论】:

  • 为什么要添加标签,当您可以使用 &lt;table style="margin-bottom:1rem"&gt; 之类的 CSS 设置样式时?
  • 我用的是插件,插件是这样工作的
  • 使用 CSS,这就是网络的运作方式。

标签: javascript php wordpress


【解决方案1】:

tablediv 标签都是块级元素。它们默认显示为两行。

以下是运行代码的结果。

【讨论】:

  • 应该是,但实际上不是:i.imgur.com/7cnQhou.jpg
  • 可能是类属性改变了样式。您可以在浏览器开发模式下检查它们。
猜你喜欢
  • 1970-01-01
  • 2014-11-18
  • 2017-04-12
  • 1970-01-01
  • 2022-10-12
  • 2012-06-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多