相关疑难解决方法(0)

将calc()与表一起使用

我正在尝试使用固定宽度tds和可变宽度tds 的表格.

我使用CSS calc()功能,但不知何故,似乎我不能%在表中使用.

这就是我到目前为止所拥有的:

<table border="0" style="width:100%;border-collapse:collapse;">
    <tr style="width:100%">
        <td style="width:30px;">1</td> <!--Fixed width-->
        <td style="width: calc( (100% - 230px) / 100 * 40);">Title</td> <!--Width should be 40% of the remaining space-->
        <td style="width: calc( (100% - 230px) / 100 * 40);">Interpret</td> <!--Width should be 40% of the remaining space-->
        <td style="width: calc( (100% - 230px) / 100 * 20);">Album</td> <!--Width should be 20% of the remaining space-->
        <td style="width:80px;">Year</td><!--Fixed width-->
        <td style="width:180px;">YouTube</td><!--Fixed …
Run Code Online (Sandbox Code Playgroud)

css html-table css3 fixed-width css-calc

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

标签 统计

css ×1

css-calc ×1

css3 ×1

fixed-width ×1

html-table ×1