html - 在 dd 上使用表格单元格

标签 html css

我正在尝试将元素排成一行。

<dt>2018.05.10</dt>
  <dd>
    <a href="http://www.nippon-shindo.co.jp/pdf/2019_03tr.pdf" target="_blank">
      <p class="cell">
        <span class="orange">></span>中間期 決算短信 &ensp;[ PDF形式 146KB ]
      </p>
    </a>
</dd>

dl {
    display: table;
    flex-wrap: wrap;
}

#summary .cell {
    display: table-cell;
}

但无法使它们内联。

最佳答案

dl {
  width: 100%;
  overflow: hidden;
  padding: 0;
  margin: 0
}

dt {
  float: left;
  width: 50%;
  /* adjust the width; make sure the total of both is 100% */
  padding: 0;
  margin: 0
}

dd {
  float: left;
  width: 25%;
  /* adjust the width; make sure the total of both is 100% */
  padding: 0;
  margin: 0
}
<dl>
  <dt>2018.05.10</dt>
  <dd>

    <a href="http://www.nippon-shindo.co.jp/pdf/2019_03tr.pdf" target="_blank">
      <p class="cell">
        <span class="orange">></span>中間期 決算短信 &ensp;[ PDF形式 146KB ]
      </p>
    </a>

  </dd>
  <dd><img align="right" src="images/summary/pdf.png"></dd>
  <dt>2017.11.14</dt>
  <dd>

    <a href="http://www.nippon-shindo.co.jp/pdf/2019_03tr.pdf" target="_blank">
      <p class="cell">
        <span class="orange">></span>中間期 決算短信 &ensp;[ PDF形式 146KB ]
      </p>
    </a>

  </dd>
  <dd><img align="right" src="images/summary/pdf.png"></dd>

  <dt>2017.08.09</dt>
  <dd>

    <a href="http://www.nippon-shindo.co.jp/pdf/2019_03tr.pdf" target="_blank">
      <p class="cell">
        <span class="orange">></span>中間期 決算短信 &ensp;[ PDF形式 146KB ]
      </p>
    </a>

  </dd>
  <dd><img align="right" src="images/summary/pdf.png"></dd>


  <dt>2018.02.14</dt>
  <dd>

    <a href="http://www.nippon-shindo.co.jp/pdf/2019_03tr.pdf" target="_blank">
      <p class="cell">
        <span class="orange">></span>中間期 決算短信 &ensp;[ PDF形式 146KB ]
      </p>
    </a>

  </dd>
  <dd><img align="right" src="images/summary/pdf.png"></dd>

</dl>

上面我有 css 使用 float 如果你想要 4 列你可以玩 css 宽度并添加 dd

两个空格 - 输入 四个空格 - 输入 Tab - 输入     

希望对你有帮助

关于html - 在 dd 上使用表格单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53754607/

相关文章:

html - 覆盖嵌套内表上的表样式

jQuery selector : this. parent,有这种东西吗?

javascript - 修复不能在 html 中使用 bootstrap 4

javascript - 如何用模态显示与图像相同的链接源?

html - 在 bootstrap 网格列上添加背景颜色,防止着色默认网格列填充

css - 跨不同域共享 CSS 样式表

css - 是否可以阻止来自 CSS 的 "external"请求?

javascript - 使用 javascript 选中复选框时重置字段中的所有输入

html - 使用 CSS 将边框半径应用于滚动条

php - 显示来自数据库的 pdf blob 文件