更改表格单元格中的字体大小

Zep*_*ays 6 html css html-table superscript text-size

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Superscript_size_in_table_cell</title>
    <meta name="generator" content="BBEdit 10.5" />
    <style>
    table {
        width: 60%;
    font-size: 0.8em;
    margin-left:auto;
    margin-right:auto;
    border-collapse: collapse;
    }

    .super_script {
    font-size: 80%;
    vertical-align: super;
    }

    </style>
</head>
<body>
    <table id="table_1a-27">
        <caption class="table_caption">Table 1A-27</caption>
        <tr>
            <td>Some text<span class="super_script">Note 1</span></td>
        </tr>
        <tr>
            <td>
                <ol>
                    <li>Beginning of sentence<span class="super_script">Note 2</span> than the rest of the sentence.</li>
                    <li>Some  stuff here</li>
                </ol>
            </td>
        </tr>
   </table>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我想更改表格单元格的部分内容的文本大小和位置,但上面似乎不适用于表格单元格中的文本.我希望能够调整表格元素的大小,而不仅仅是为了上标目的.

Dot*_*tan 1

它不起作用,因为您没有定义刚刚放入的单元格类

 class="super_script"
Run Code Online (Sandbox Code Playgroud)

在 td 标签中。

要更改单元格的大小,请确保这样做

 table {table-layout: fixed;}
Run Code Online (Sandbox Code Playgroud)

你应该已经准备好了!