PHP历理 拼音元音的表格列表

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>测试</title>
    <link rel="stylesheet" href="/_/_js/layui/css/layui.css">
    <link rel="stylesheet" href="/_/_css/base.css">
    <script src="/_/_js/layui/layui.js"></script>
    <script src="/_/_js/jquery-1.10.1.min.js"></script>
</head>
<body>
<?php
$toneMap = [
    'a' => ['ā', 'á', 'ǎ', 'à'],
    'e' => ['ē', 'é', 'ě', 'è'],
    'i' => ['ī', 'í', 'ǐ', 'ì'],
    'o' => ['ō', 'ó', 'ǒ', 'ò'],
    'u' => ['ū', 'ú', 'ǔ', 'ù'],
    'ü' => ['ǖ', 'ǘ', 'ǚ', 'ǜ'],
];
// HTML 表格输出
echo '<table class="layui-table"  style="max-width: 320px;">';
echo '<tr><th>元音</th><th>一声</th><th>二声</th><th>三声</th><th>四声</th></tr>';

foreach ($toneMap as $vowel => $tones) {
    echo '<tr>';
    echo '<td>' . $vowel . '</td>'; // 首列显示元音
    foreach ($tones as $tone) {
        echo '<td>' . $tone . '</td>'; // 后续列显示声调符号
    }
    echo '</tr>';
}
echo '</table>';
?>
</body>
</html>

效果图:

posted @ 2025-05-09 17:30  onestopweb  阅读(11)  评论(0)    收藏  举报