DashTable icon indicating copy to clipboard operation
DashTable copied to clipboard

dashtable.html2rst errors with `ERROR: One of the span's rows extends beyond the bounds of the table: [[15, 0], [16, 0]]`

Open jiangying000 opened this issue 2 years ago • 0 comments

code

import dashtable
if __name__ == '__main__':
    # print(html_to_markdown('''
    # print(dashtable.html2md('''
    # print(dashtable.html2data('''
    print(dashtable.html2rst('''
    <table class="detailList col01" style="background-color:#fff;">
        <thead>
            <tr>
                <th></th>
                <th class="step" scope="col">
                    <div class="text">データ定額<br>440プラン</div>
                </th>
                <th scope="col">
                    <div class="text"><span class="linkTxt typeA"><a href="/domestic/service/vita" target="_blank"
                                class="bgBlue newWindow" rel="noopener noreferrer">ビタッ!<br>プラン</a></span></div>
                </th>
                <th scope="col">
                    <div class="text"><span class="linkTxt typeA"><a href="/domestic/planlp_jiyujizai_super" target="_blank"
                                class="bgBlue newWindow" rel="noopener noreferrer">自由自在<br>プラン</a></span></div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">Rakuten<br>最強プラン</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">ahamo</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">LINEMO</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">povo2.0</div>
                </th>
            </tr>
            <tr style="border-top:0; padding-top:0;">
                <th style="border-left:0;"></th>
                <th class="step" scope="col">
                    <ul class="planFunctionIcon">
                        <li class="data">データ</li>
                    </ul>
                </th>
                <th scope="col">
                    <ul class="planFunctionIcon">
                        <li class="data">データ</li>
                    </ul>
                </th>
                <th scope="col">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th scope="row" colspan="8">月額基本料金</th>
            </tr>
            <tr>
                <th scope="row">~100MB<br>まで</th>
                <td rowspan="2" style="background-color:#ffffcc;"><strong>440円</strong></td>
                <td><strong>198円</strong></td>
                <td rowspan="2">
                    <div class="secBoxCompareBalloonCnt">
                        <p>100MB未満の月は<br><strong>290円!</strong></p>
                    </div>
                    <div class="text">
                        <p><strong>550円~</strong></p>
                    </div>
                </td>
                <td rowspan="4"><strong>1,078円</strong></td>
                <td rowspan="8"><strong>2,970円</strong></td>
                <td rowspan="4"><strong>990円</strong></td>
                <td rowspan="2">
                    <div class="text">
                        <p><strong>390円</strong></p>
                    </div>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">7日間</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th scope="row">~1GB</th>
                <td rowspan="2"><strong>770円</strong></td>
            </tr>
            <tr>
                <th scope="row">~2GB</th>
                <td rowspan="2" style="background-color:#ffffcc;"><strong>580円</strong></td>
                <td rowspan="2"><strong>770円</strong></td>
                <td rowspan="2"><strong>990円</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">30日間</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th scope="row">~3GB</th>
                <td rowspan="2"><strong>1,320円</strong></td>
            </tr>
            <tr>
                <th scope="row">~5GB</th>
                <td rowspan="2" style="background-color:#ffffcc; border:3px solid #FFCD00;"><strong>880円</strong></td>
                <td rowspan="2"><strong>990円</strong></td>
                <td rowspan="4"><strong>2,178円</strong></td>
                <td rowspan="4"><strong>2,728円</strong></td>
                <td rowspan="4"><strong>2,700円</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">30日間</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th scope="row">~7GB</th>
                <td rowspan="2"><strong>2,310円</strong></td>
            </tr>
            <tr>
                <th scope="row">~10GB</th>
                <td rowspan="2" style="background-color:#ffffcc; border:3px solid #FFCD00;"><strong>1,980円</strong></td>
                <td rowspan="2"><strong>2,190円</strong><br>5分かけ放題付!</td>
            </tr>
            <tr>
                <th scope="row">~20GB</th>
                <td>15GBまで<br><strong>3,300円</strong></td>
            </tr>
            <tr>
                <th scope="row">~30GB</th>
                <td rowspan="2" style="background-color:#ffffcc;"><strong>4,980円</strong></td>
                <td><strong>5,775円</strong></td>
                <td rowspan="2"><strong>5,990円</strong><br>5分かけ放題付!</td>
                <td rowspan="2"><strong>3,278円</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">パートナー回線エリアは最大1Mbpsで使い放題</li>
                    </ul>
                </td>
                <td rowspan="2"><strong>4,950円</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">オプション<br>100GBまで</li>
                    </ul>
                </td>
                <td rowspan="2">+550円/1GB<br>で追加可</td>
                <td rowspan="2"><strong>6,490円</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">60GB/<br>90日間</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th scope="row">~50GB</th>
                <td style="background-color: #f7f7f7;">+330円/1GB<br>で追加可</td>
            </tr>
            <tr>
                <th scope="row" colspan="8">通話料・オプション</th>
            </tr>
            <tr>
                <th scope="row">回線</th>
                <td style="background-color:#ffffcc;">NTTドコモ</td>
                <td>NTTドコモ<br>ソフトバンク</td>
                <td>NTTドコモ</td>
                <td>楽天</td>
                <td>NTTドコモ</td>
                <td>ソフトバンク</td>
                <td>au</td>
            </tr>
            <tr>
                <th scope="row">通話料</th>
                <td rowspan="2" style="background-color:#ffffcc;">–</td>
                <td rowspan="2">–</td>
                <td><strong>9円/30秒</strong><br>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1"><strong>専用アプリ<br>不要</strong></li>
                    </ul>
                </td>
                <td><strong>22円/30秒</strong><br>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">専用アプリ利用で国内通話かけ放題</li>
                    </ul>
                </td>
                <td><strong>22円/30秒</strong><br>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">国内通話5分まで無料</li>
                    </ul>
                </td>
                <td><strong>22円/30秒</strong></td>
                <td><strong>22円/30秒</strong></td>
            </tr>
            <tr>
                <th scope="row">通話<br>オプション<br><strong>※1</strong></th>
                <td>5分かけ放題<br><strong>500円/月</strong><br>完全かけ放題<br><strong>1,480円/月</strong></td>
                <td>15分かけ放題<br><strong>1,100円/月</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">専用アプリ不要</li>
                    </ul>
                </td>
                <td>かけ放題<br><strong>1,100円/月</strong></td>
                <td>5分/回以内<br>かけ放題<br><strong>550円/月</strong><br>通話定額<br><strong>1,650円/月</strong></td>
                <td>5分以内かけ放題<br><strong>550円/月</strong><br>通話かけ放題<br><strong>1,650円/月</strong></td>
            </tr>
            <tr>
                <th scope="row">データ追加</th>
                <td style="background-color:#ffffcc;"><strong>200円/1GB</strong></td>
                <td><strong>330円/1GB</strong></td>
                <td><strong>200円/1GB</strong></td>
                <td><strong>–</strong>
                    <ul class="list typeB">
                        <li data-number="1">0GB~無制限まで従量課金</li>
                    </ul>
                </td>
                <td><strong>550円/1GB</strong></td>
                <td><strong>550円/1GB</strong></td>
                <td><strong>390円/1GB~</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">1・3・20・60GB<br>単位で追加可</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th scope="row">SMS追加<br><strong>※2</strong></th>
                <td style="background-color:#ffffcc; border:3px solid #FFCD00;"><strong>50円/月</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">1GB~7GBのみ</li>
                    </ul>
                </td>
                <td><strong>154円/月</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">ドコモ回線のみ</li>
                    </ul>
                </td>
                <td><strong>–</strong>
                    <ul class="list typeB">
                        <li data-number="1">月額基本料金に含まれる</li>
                    </ul>
                </td>
                <td><strong>–</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">月額基本料金に含まれる</li>
                    </ul>
                </td>
                <td><strong>–</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">月額基本料金に含まれる</li>
                    </ul>
                </td>
                <td><strong>–</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">月額基本料金に含まれる</li>
                    </ul>
                </td>
                <td><strong>–</strong>
                    <ul class="list typeB" style="margin-top: 0.1rem;">
                        <li data-number="1">月額基本料金に含まれる</li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th></th>
                <th class="step" scope="col">
                    <div class="text">データ定額<br>440プラン</div>
                </th>
                <th scope="col">
                    <div class="text"><span class="linkTxt typeA"><a href="/domestic/service/vita" target="_blank"
                                class="bgBlue newWindow" rel="noopener noreferrer">ビタッ!<br>プラン</a></span></div>
                </th>
                <th scope="col">
                    <div class="text"><span class="linkTxt typeA"><a href="/domestic/planlp_jiyujizai_super" target="_blank"
                                class="bgBlue newWindow" rel="noopener noreferrer">自由自在<br>プラン</a></span></div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">Rakuten<br>最強プラン</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">ahamo</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">LINEMO</div>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <div class="text">povo2.0</div>
                </th>
            </tr>
            <tr style="border-top:0; padding-top:0;">
                <th></th>
                <th class="step" scope="col">
                    <ul class="planFunctionIcon">
                        <li class="data">データ</li>
                    </ul>
                </th>
                <th scope="col">
                    <ul class="planFunctionIcon">
                        <li class="data">データ</li>
                    </ul>
                </th>
                <th scope="col">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
                <th scope="col" style="background-color: #F7F7F7;">
                    <ul class="planFunctionIcon">
                        <li class="voice">音声通話</li>
                        <li class="data">データ</li>
                        <li class="sms">SMS</li>
                    </ul>
                </th>
            </tr>
        </tbody>
    </table>
    '''))

jiangying000 avatar Aug 08 '23 19:08 jiangying000