CSS画一个无边框表格
时间: 2024-02-23 22:57:19 浏览: 82
Designing without tables using CSS
->right;
}
sibling->color = parent->color;
parent->color = RB_BLACK;
sibling->right->color = RB_BLACK;
rb_rotate_left(parent, root);
break;
}
} else {
struct rb_node *sibling可以使用 CSS 的 border-collapse 和 border-spacing 属性来画一个无边框表格,示例代码如下:
```html
<table = parent->left;
if (sibling->color == RB_RED) {
sibling->color = RB_BLACK;
parent-> style="border-collapse: collapse; border-spacing: 0;">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
color = RB_RED;
rb_rotate_right(parent, root);
sibling = parent->left;
}
if ((!sibling-> <td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</left || sibling->left->color == RB_BLACK) &&
(!sibling->right || sibling->right->color == RB_BLACK))td>
<td>8</td>
<td>9</td>
</tr>
</table>
```
这里 {
sibling->color = RB_RED;
child = parent;
parent = child->parent;
} else {
if (!设置了 border-collapse 属性为 collapse,这意味着单元格之间的边框将会合并为一个单一的sibling->left || sibling->left->color == RB_BLACK) {
sibling->right->color = RB_BLACK;
sibling->边框,而不是每个单元格都有自己的边框。同时,设置了 border-spacing 属性为 0color = RB_RED;
rb_rotate_left(sibling, root);
sibling = parent->left;
}
sibling->color =,这样单元格之间的距离就为 0,实现了无边框表格的效果。
阅读全文