我正在使用<table>
,<tr>
,<td>
标签来设计一个表。我设计了一个表但是当来自数据库的数据进行设计时会发生什么表扩展看起来很糟糕。我将显示一个图像。
正如您在上面的图片中看到的那样,当数据扩展时,表格宽度也在扩展,但我需要的是扩展<td>
标签的高度而不是宽度。我发布的代码如下我做了。
<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    Buyer/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">
 <%= companyName%><br/>
 <%= branchLocationAddress%><br/>
<b> Mobile Number: </b><%= mobileNumber%><br/>
<b> Phone Number: </b><%= landLineNumber%><br/>
<b> Email ID: </b><%= emailID%>
</td>
<td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b> Invoice No</b><br/>
 <%= invoiceno%></td>
<td style="border-bottom: 1px solid black;"><b> Invoice Date</b><br/>
 <%= invoicedate%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;"><b> Delivery Note</b><br/>
 <%= deliverynote%></td>
<td><b> Mode Of Payment</b><br/>
 <%= termsofpayment%> </td>
</tr>
<tr>
<td style="border-top: 1px solid black;border-bottom: 1px solid black;border-right: 1px solid black;"><b> ESugam No</b><br/>
 <%= esugamno%></td>
<td style="border-top: 1px solid black;border-bottom: 1px solid black;"><b> Other Reference</b></td>
</tr>
<tr>
<td rowspan="3" style="border-top: 1px solid black; width: 300px;border-right: 1px solid black;"><b> OrganizationName: </b><%= orgname%><br/>
<b> Delivery Address: </b><%= deliveryaddress%><br/>
<b> Phone No :</b><%= phone%></td>
<td style="border-right: 1px solid black;border-bottom: 1px solid black"><b> Buyer Order No</b><br/>
 <%= buyerorderno%></td>
<td style="border-bottom: 1px solid black;"><b> Buy Date</b><br/>
 <%= buydate%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b> Dispatch Document No</b><br/>
 <%= dispatchdocumentno%></td>
<td style="border-bottom: 1px solid black;"><b> Dated</b><br/>
 <%= dated%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;"><b> Dispatch Through</b><br/>
 <%= dispatchthrough%></td>
<td><b> Destination</b><br/>
 <%= 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> Works Address: Same As Above</b></td>
<td style="border-right: 1px solid black;"><b> Terms Of Delivery :- </b><%= termsofdelivery%><br/>
<b> Attention :- </b><%= attention %></td></tr>
</table>
答案 0 :(得分:0)
word-break: break-all
诀窍
答案 1 :(得分:-1)
你的div在桌子开始前关闭。将你的桌子包裹在div中。
mysql> SELECT max( dateTime ) FROM archive;
+-----------------+
| max( dateTime ) |
+-----------------+
| 1457104500 |
+-----------------+
1 row in set (0.00 sec)
mysql> SELECT max( FROM_UNIXTIME(dateTime,"%M %m") ) as 'date' FROM archive;
+----------+
| date |
+----------+
| March 03 |
+----------+
1 row in set (0.02 sec)
mysql> SELECT max( FROM_UNIXTIME(dateTime,"%m %M") ) as 'date' FROM archive;
+-------------+
| date |
+-------------+
| 12 December |
+-------------+
1 row in set (0.02 sec)
干杯
答案 2 :(得分:-1)
您的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    Buyer/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">
 <%= companyName%><br/>
 <%= branchLocationAddress%><br/>
<b> Mobile Number: </b><%= mobileNumber%><br/>
<b> Phone Number: </b><%= landLineNumber%><br/>
<b> Email ID: </b><%= emailID%>
</td>
<td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b> Invoice No</b><br/>
 <%= invoiceno%></td>
<td style="border-bottom: 1px solid black;"><b> Invoice Date</b><br/>
 <%= invoicedate%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;"><b> Delivery Note</b><br/>
 <%= deliverynote%></td>
<td><b> Mode Of Payment</b><br/>
 <%= termsofpayment%> </td>
</tr>
<tr>
<td style="border-top: 1px solid black;border-bottom: 1px solid black;border-right: 1px solid black;"><b> ESugam No</b><br/>
 <%= esugamno%></td>
<td style="border-top: 1px solid black;border-bottom: 1px solid black;"><b> Other Reference</b></td>
</tr>
<tr>
<td rowspan="3" style="border-top: 1px solid black; width: 300px;border-right: 1px solid black;"><b> OrganizationName: </b><%= orgname%><br/>
<b> Delivery Address: </b><%= deliveryaddress%><br/>
<b> Phone No :</b><%= phone%></td>
<td style="border-right: 1px solid black;border-bottom: 1px solid black"><b> Buyer Order No</b><br/>
 <%= buyerorderno%></td>
<td style="border-bottom: 1px solid black;"><b> Buy Date</b><br/>
 <%= buydate%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;border-bottom: 1px solid black;"><b> Dispatch Document No</b><br/>
 <%= dispatchdocumentno%></td>
<td style="border-bottom: 1px solid black;"><b> Dated</b><br/>
 <%= dated%></td>
</tr>
<tr>
<td style="border-right: 1px solid black;"><b> Dispatch Through</b><br/>
 <%= dispatchthrough%></td>
<td><b> Destination</b><br/>
 <%= 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> Works Address: Same As Above</b></td>
<td style="border-right: 1px solid black;"><b> Terms Of Delivery :- </b><%= termsofdelivery%><br/>
<b> Attention :- </b><%= attention %></td></tr>
</table> </div>
它将解决您的问题。如果您有任何其他问题,请告诉我。感谢