Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何以适当的方式获取table tag的td标签_Javascript_Jquery_Html_Css_Jsp - Fatal编程技术网

Javascript 如何以适当的方式获取table tag的td标签

Javascript 如何以适当的方式获取table tag的td标签,javascript,jquery,html,css,jsp,Javascript,Jquery,Html,Css,Jsp,我正在使用,,标记来设计一个表。我设计了一个表,但当来自数据库的数据使表的设计扩展时,会发生什么,这看起来非常糟糕。我将显示一个图像 如上图所示,当数据扩展时,表格宽度也在扩展,但我需要扩展的是标记的高度,而不是宽度。我在下面发布了我所做的代码 <div style="border-left: 1px solid black;border-right: 1px solid black;border-top: 1px solid black;width:608px"><cente

我正在使用
标记来设计一个表。我设计了一个表,但当来自数据库的数据使表的设计扩展时,会发生什么,这看起来非常糟糕。我将显示一个图像

如上图所示,当数据扩展时,表格宽度也在扩展,但我需要扩展的是
标记的高度,而不是宽度。我在下面发布了我所做的代码

<div style="border-left: 1px solid black;border-right: 1px solid black;border-top: 1px solid black;width:608px"><center><span style="font-size: 18px;"><b>Tax Invoice cum Delivery Challan &nbsp&nbsp&nbspBuyer/Seller Copy</b></span></center></div>
            <table align="center" style="border: 1px solid " cellpadding="0" cellspacing="0" width="100%">
               <tr>
               <td rowspan="3" style="border-right: 1px solid black; width: 300px">
               &nbsp<%= companyName%><br/>
                        &nbsp<%= branchLocationAddress%><br/>
                        <b>&nbspMobile Number: </b><%= mobileNumber%><br/>
                        <b>&nbspPhone Number: </b><%= landLineNumber%><br/>
                        <b>&nbspEmail ID: </b><%= emailID%>
               </td>
               <td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b>&nbspInvoice No</b><br/>
                   &nbsp<%= invoiceno%></td>
               <td style="border-bottom: 1px solid black;"><b>&nbspInvoice Date</b><br/>
                        &nbsp<%= invoicedate%></td>
               </tr>
               <tr>

               <td style="border-right: 1px solid black;"><b>&nbspDelivery Note</b><br/>
                   &nbsp<%= deliverynote%></td>
               <td><b>&nbspMode Of Payment</b><br/>
                    &nbsp<%= termsofpayment%> </td>    
               </tr>
               <tr>

               <td style="border-top: 1px solid black;border-bottom: 1px solid black;border-right: 1px solid black;"><b>&nbspESugam No</b><br/>
                   &nbsp<%= esugamno%></td>
               <td style="border-top: 1px solid black;border-bottom: 1px solid black;"><b>&nbspOther Reference</b></td> 
               </tr>
               <tr>
               <td rowspan="3" style="border-top: 1px solid black; width: 300px;border-right: 1px solid black;"><b>&nbspOrganizationName: </b><%= orgname%><br/>
                        <b>&nbspDelivery Address: </b><%= deliveryaddress%><br/>
                        <b>&nbspPhone No :</b><%= phone%></td>
                <td style="border-right: 1px solid black;border-bottom: 1px solid black"><b>&nbspBuyer Order No</b><br/>
                        &nbsp<%= buyerorderno%></td>  
                <td style="border-bottom: 1px solid black;"><b>&nbspBuy Date</b><br/>
                         &nbsp<%= buydate%></td>              
               </tr>
               <tr>

               <td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b>&nbspDispatch Document No</b><br/> 
                        &nbsp<%= dispatchdocumentno%></td>
               <td style="border-bottom: 1px solid black;"><b>&nbspDated</b><br/>
                      &nbsp<%= dated%></td>         
               </tr>
               <tr>

               <td style="border-right: 1px solid black;"><b>&nbspDispatch Through</b><br/>
                          &nbsp<%= dispatchthrough%></td>
               <td><b>&nbspDestination</b><br/>
                        &nbsp<%= destination%></td>           
               </tr>
                </table> 
            <table align="center" style="border-bottom: 1px solid " cellpadding="0" cellspacing="0" width="100%">

               <tr>
               <td rowspan="1" style="width:300px; border-left: 1px solid black; border-right: 1px solid black;"><b>&nbspWorks Address: Same As Above</b></td>
               <td style="border-right: 1px solid black;"><b>&nbspTerms Of Delivery :- </b><%= termsofdelivery%><br/>
                      <b>&nbspAttention :- </b><%= attention %></td></tr>
                  </table>  
税务发票和交货查兰nbsp买方/卖方副本
 
 
 Mobile号码:
&NBS电话号码:
&NBS邮件ID: &NBS语音编号
  &NBS语音日期
   Delivery注释
  &NBSP付款方式
   ESugam编号
  &斯波特参考 &NBS组织名称:
 Delivery地址:
&电话号码: &NBSP买方订单号
   Buy日期
   Dispatch文件编号
   Dated
   Dispatch通过
   Destination
   Works地址:同上 &NBSP交货条件:-
&NBSPAtension:-
您的div在表启动之前关闭。把你的桌子包在沙发里

<div style="border-left: 1px solid black;border-right: 1px solid black;border-top: 1px solid black;width:608px"><center><span style="font-size: 18px;"><b>Tax Invoice cum Delivery Challan &nbsp&nbsp&nbspBuyer/Seller Copy</b></span></center>

<table>[..]</table>  
</div>
税务发票和交货查兰nbsp买方/卖方副本
[..]  

干杯

您的div标签将在table标签之前关闭。这样做:-

    <div style="border-left: 1px solid black;border-right: 1px solid black;border-top: 1px solid black;width:608px"><center><span style="font-size: 18px;"><b>Tax Invoice cum Delivery Challan &nbsp&nbsp&nbspBuyer/Seller Copy</b></span></center>
        <table align="center" style="border: 1px solid " cellpadding="0" cellspacing="0" width="100%">
           <tr>
           <td rowspan="3" style="border-right: 1px solid black; width: 300px">
           &nbsp<%= companyName%><br/>
                    &nbsp<%= branchLocationAddress%><br/>
                    <b>&nbspMobile Number: </b><%= mobileNumber%><br/>
                    <b>&nbspPhone Number: </b><%= landLineNumber%><br/>
                    <b>&nbspEmail ID: </b><%= emailID%>
           </td>
           <td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b>&nbspInvoice No</b><br/>
               &nbsp<%= invoiceno%></td>
           <td style="border-bottom: 1px solid black;"><b>&nbspInvoice Date</b><br/>
                    &nbsp<%= invoicedate%></td>
           </tr>
           <tr>

           <td style="border-right: 1px solid black;"><b>&nbspDelivery Note</b><br/>
               &nbsp<%= deliverynote%></td>
           <td><b>&nbspMode Of Payment</b><br/>
                &nbsp<%= termsofpayment%> </td>    
           </tr>
           <tr>

           <td style="border-top: 1px solid black;border-bottom: 1px solid black;border-right: 1px solid black;"><b>&nbspESugam No</b><br/>
               &nbsp<%= esugamno%></td>
           <td style="border-top: 1px solid black;border-bottom: 1px solid black;"><b>&nbspOther Reference</b></td> 
           </tr>
           <tr>
           <td rowspan="3" style="border-top: 1px solid black; width: 300px;border-right: 1px solid black;"><b>&nbspOrganizationName: </b><%= orgname%><br/>
                    <b>&nbspDelivery Address: </b><%= deliveryaddress%><br/>
                    <b>&nbspPhone No :</b><%= phone%></td>
            <td style="border-right: 1px solid black;border-bottom: 1px solid black"><b>&nbspBuyer Order No</b><br/>
                    &nbsp<%= buyerorderno%></td>  
            <td style="border-bottom: 1px solid black;"><b>&nbspBuy Date</b><br/>
                     &nbsp<%= buydate%></td>              
           </tr>
           <tr>

           <td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b>&nbspDispatch Document No</b><br/> 
                    &nbsp<%= dispatchdocumentno%></td>
           <td style="border-bottom: 1px solid black;"><b>&nbspDated</b><br/>
                  &nbsp<%= dated%></td>         
           </tr>
           <tr>

           <td style="border-right: 1px solid black;"><b>&nbspDispatch Through</b><br/>
                      &nbsp<%= dispatchthrough%></td>
           <td><b>&nbspDestination</b><br/>
                    &nbsp<%= destination%></td>           
           </tr>
            </table> 
        <table align="center" style="border-bottom: 1px solid " cellpadding="0" cellspacing="0" width="100%">

           <tr>
           <td rowspan="1" style="width:300px; border-left: 1px solid black; border-right: 1px solid black;"><b>&nbspWorks Address: Same As Above</b></td>
           <td style="border-right: 1px solid black;"><b>&nbspTerms Of Delivery :- </b><%= termsofdelivery%><br/>
                  <b>&nbspAttention :- </b><%= attention %></td></tr>
              </table>  </div>
税务发票和交货查兰nbsp买方/卖方副本
 
 
 Mobile号码:
&NBS电话号码:
&NBS邮件ID: &NBS语音编号
  &NBS语音日期
   Delivery注释
  &NBSP付款方式
   ESugam编号
  &斯波特参考 &NBS组织名称:
 Delivery地址:
&电话号码: &NBSP买方订单号
   Buy日期
   Dispatch文件编号
   Dated
   Dispatch通过
   Destination
   Works地址:同上 &NBSP交货条件:-
&NBSPAtension:-
它会解决你的问题。如果你还有什么问题,告诉我。谢谢

word-break: break-all 

这个诀窍

看起来你需要在CSS@Rorymcrossan中使用
word break:break all
,它工作得很好,看起来很不错。谢谢word break:break all可以实现这个诀窍。当我像你说的那样使用它时,它变得更糟糕了。根据你提供的代码,它工作得很好,你可以在这里看到:也许你已经决定使用它了另一个建议也提供了,但我真的不明白为什么不应该有一个以上的正确答案。