zoukankan      html  css  js  c++  java
  • markdown 表格宽度调整

    先在浏览器中看看 HTML是怎样的:
    <table> <thead> <tr> <th>名称</th> <th></th> <th>备注</th> </tr> </thead> <tbody> <!-- 省略 tbody 内容 --> </tbody> </table>
    利用浏览器上的开发者工具我们可以调试一下,把【名称】左边的 <th> 改为:
    <th style=" 100px;">
    • 1
      看起来似乎不错。回到 Markdown 上,在原表格前添加 CSS 代码,类似这样:
    <style> table th:first-of-type { 100px; } </style> <!-- 下方是表格的 Markdown 语法 --!>
    首先 <th> 存在于 <table> 中;其次 th:first-of-type 的意思是每个 <th> 为其父级的第一个元素,这里指的就是围绕着【名称】的 <th>。同理第二、三个使用 th:nth-of-type(2)th:nth-of-type(3) 就可以了,以此类推。 
      上述的 th:first-of-type 等于 th:nth-of-type(1)
  • 相关阅读:
    UDP 远程主机强迫关闭了一个现有连接
    CSS float 理解
    C# 启用事务提交多条带参数的SQL语句
    EF学习之DBFirst
    说一说JavaScript 中的原型ProtoType
    Unity
    Unity
    Unity
    Unity
    Godot
  • 原文地址:https://www.cnblogs.com/elesos/p/9016239.html
Copyright © 2011-2022 走看看