1

我需要为单元格高度固定的 HTML 表格添加键盘访问。也就是说,如果单元格中出现滚动条(给出的示例),则键盘需要能够使用箭头键滚动该单元格。我怎样才能做到这一点?我需要支持 Internet Explorer 6、7 及更高版本。

非常感谢您提前提供的帮助。

表格示例:

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <html lang="en">
        <head>
            <title>Simplified</title>
        </head>
        <body>
        <table width="100%" cellspacing="0" cellpadding="0" border="1" BGCOLOR="#E8E8E8">
            <tr align="center">
            <td valign="top">
                <strong>List</strong>
            </td>
            </tr>
            <tr align="center">
            <td>
                <table width="100%" border="1" cellspacing="0" cellpadding="2" id="reasonList">
                    <tr>
                    <th scope="row" width="15%">
                        <span class="workArea">
                        <a href="http://www.somewhere.com/someHTML.html"><nobr>Entry Number</nobr></a>
                        </span>
                    </th>
                    <td width="20%" align="center">
                        <span class="workArea">
                        <nobr>ALL</nobr>
                        </span>
                    </td>
                    <td width="10%" align="center">
                        <span class="workArea">
                        <nobr>A</nobr>
                        </span>
                    </td>
                    <td width="10%">
                        <span class="workArea">
                            <nobr>B</nobr>
                        </span>
                    </td>
                    <td width="35%" align="left">
                        <div style="overflow:auto; width: 330px; height: 110px;">
                            <span class="workArea">
                                            Returned Customer<br>
                                            Refund Requested<br>
                                            Change of Address<br>
                                            Denied Delivery<br>
                                            Expedited processing<br>
                                            Data Entry Errors<br>
                                            Not Ready for Delivery<br>
                                            Other Notices<br>
                                            Billing Error<br>
                                            Shipping Error<br>
                                            Rejected Delivery<br>
                            </span>
                        </div>
                    </td>
                    <td width="15%">
                        <span class="workArea">
                        <nobr>07/15/2012</nobr>
                        </span>
                    </td>
                    </tr>
                </table>
            </td>
            </tr>
        </table>
        </body>
    </html>
4

1 回答 1

0

您应该能够通过添加tabindex="-1"到有问题的单元格来赋予单元格焦点。

于 2013-01-13T18:29:03.427 回答