php - 标签时在文本字段表中从上到下而不是从左到右聚焦

标签 php html

我有一个表格形式的 html 表格,学生必须在其中填写他的科目(表格一旦完成就会看起来像类(class)表)。我在修改选项卡的行为时遇到了问题,我希望它垂直移动,而不是默认的从左到右移动,以允许用户以这种方式填充所有类:

       MON

7 - 8

8 - 9

9 - 10

等而不是

       MON    TUES    WED

7-8

有没有简单的方法可以做到这一点?也欢迎就如何在不使用文本框表格的情况下获取学生的类(class)表提出建议。

编辑: tabindex 没怎么用,因为我是以从左到右的方式创建表格的

for($h=0; $h<sizeof($time); $h++) {
        echo "<tr><td> " . $time[$h] . "</td>";
        for($i=0; $i<DAYS; $i++)
            echo "<td><input type='text' name='subject[]' id='subject' autocomplete='off' tabindex='" . $k . "'></td>";
        echo "</tr>";
    }

最佳答案

为该输入文本字段提供 tabindex

<input type='text' tabindex="0">
<input type='text' tabindex="1">
<input type='text' tabindex="2">

关于php - 标签时在文本字段表中从上到下而不是从左到右聚焦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16603543/

相关文章:

php - Firefox 和 chrome 中的页面无法正确显示 ul

php - 已解决 : Compiling PHP with GD : relocation R_X86_64_PC32 against symbol `WebPMemoryWrite' can not be used when making a shared object;

javascript - 使用 jquery 删除 div 元素而不删除其中的任何内容

html - <table> 标记的属性 "Width"在 Outlook 中无法正常工作

PHP - 将 PDO 与 IN 子句数组一起使用

php - Symfony2 UniqueEntity 不工作 : throws db exception

php - 在 PHP 中获取 PDF 文件的内容

javascript - 在网站上显示 .mov 作为加载屏幕的最佳方式

html - 我可以使用 :after 在图标集上设置流体宽度吗

python - BeautifulSoup 找不到正确解析的元素