是否可以在可滾動的 tbody 頂部覆蓋 SVG 畫布?我需要在我的 trs 中的 div 之間畫線。如果可以在可滾動的 tbody 上覆蓋 SVG 畫布,則非常感謝任何示例。以下是我正在使用的表的示例,表溢出是自動的。在此示例中,我試圖在“連接 1”和“連接 2”之間畫一條線,并且當我向左/向右或向上/向下滾動表格時,我希望使線保持與這兩個組件的連接。<table> <thead> <tr> <th>1 </th> <th>2 </th> <th>3 </th> </tr> </thead> <tbody> <svg style=" position: absolute; width: 100%; height: 100%; top: 0; left: 0;"> <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2"></line></svg> <tr style="height: 30px;"> <td style="position: absolute; left: 100px;"> <div>Connection 1 </div> </td> </tr> <tr style="height: 30px;"> <td> <div style="position: absolute; left: 200px;">Connection 2 </div> </td> </tr> <tr style="height: 30px;"> <td> <div style="position: absolute; left: 400px;">Connection 3 </div> </td> </tr> <tbody></table>
在表格的頂部覆蓋 SVG
桃花長相依
2022-06-16 15:27:29