相关疑难解决方法(0)

放一个&nbsp;是不是很好 在一个空的<td>里面?

如果这是结构:

<table cellspacing="0" cellpadding="0">
   <tr>
      <td>I don't need anything here, should I always put a &nbsp; here?</td>
      <td>item </td>
   </tr>
   <tr>
      <td>model</td>
      <td>one</td>
   </tr>
   <tr>
      <td>model</td>
      <td>two</td>
   </tr>
   <tr>
      <td>model</td>
      <td>three</td>
   </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

屏幕阅读器如何读取空白td?它在语义上是否正确?

html w3c semantic-markup

24
推荐指数
2
解决办法
4万
查看次数

如何让表格单元格向右对齐?

我有一个有两排的桌子.
看起来像这样:

—————————————————
|   1   |   2   |
|———————————————|
|   3   |       |
—————————————————
Run Code Online (Sandbox Code Playgroud)

第一行有两个单元格,但第二行只有一个单元格.

如何在第二行中获取唯一的表格单元格,以便在第一行中的第二个表格单元格下对齐?(不在第二行中的单元格之前添加单元格)
像这样:

—————————————————
|   1   |   2   |
|———————————————|
|       |   3   |
—————————————————
Run Code Online (Sandbox Code Playgroud)

这是我的HTML:

<div class="table">
    <div class="row">
        <div class="cell one">
            1
        </div>
        <div class="cell two">
            2
        </div>
    </div>
    <div class="row">
        <div class="cell three">
            3
        </div>
    </div>
 </div>
Run Code Online (Sandbox Code Playgroud)

我的CSS:

div.table {
    display:table;
    background:#EEE;
    padding:10px;
}
 div.row {
    display:table-row;
    background:#610;
    padding:10px;
    width:100%;
    text-align:right;
}
 div.cell {
    display:table-cell;
    background:#016;
    padding:10px;
    color:white;
    font-family:sans-serif;
}
Run Code Online (Sandbox Code Playgroud)

jsFiddle.

我试过边缘和花车.如果可能的话,我想避免绝对和漂浮.

css alignment css3 css-tables

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

alignment ×1

css ×1

css-tables ×1

css3 ×1

html ×1

semantic-markup ×1

w3c ×1