gpt4 book ai didi

html - 如何在所有浏览器中添加表格边框并使表格居中?

转载 作者:太空宇宙 更新时间:2023-11-03 19:13:57 28 4
gpt4 key购买 nike

谁能告诉我如何在 Google Chrome 中为表格添加边框?以及如何在 Firefox、Safari、Opera、Chrome 中对齐表格“居中”。

请找到附件代码:

<html>
<head>
<style type="text/css">
.mainpagebordr {
BORDER-BOTTOM: #000000 1px solid;
BORDER-LEFT: #000000 1px solid;
BORDER-COLLAPSE: collapse;
BORDER-TOP: #000000 1px solid;
BORDER-RIGHT: #000000 1px solid;
margin-left : auto;
margin-right: auto;
margin-left: auto;
}
.marginStyle{margin: 0 auto;}
</style>
</head>
<body>


<center>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="marginStyle" align="center">

<tr class="rcptFont">

<tr>

<td width="26.7%">&nbsp;

</td>

<td align="center" width="480px" valign="top">

<table border="0" class="mainpagebordr marginStyle" height="730" align="center">

<tr class="rcptFont">

<td width="175" valign="top" height="10%">

<table width="200" align="left">

<tr>

<td width="105" height="90" style="padding-left: 10px">

<img src="/URAPortalBC/Common/images/ura5.jpg" height="112" width="160"/>

</td>

</tr>

<tr class="rcptFont1">

<td width="175">

</td>

</tr>

</table>

</td>



<td colspan="4" width="245" align="center" class="withBorder marginStyle" valign="top">

<table align="center" class="withBorder marginStyle" width="245">

<tr class="rcpthead">

<td width="245" align="center">

<strong>Uganda Revenue Authority</strong>

</td>

</tr>

<tr class="rcptFont1">

<td align="center">Kampala Area office Plot 51,Windsor Crescent P.O.box 1234 Kampala,Uganda</td>

</tr>



<tr class="rcpthead">

<td align="center" >

<strong>Acknowledgement Receipt</strong>

</td>

</tr>

<tr class="rcptFont" >

<td align="center">

<strong>Declaration of Instrument</strong>

</td>

</tr>

</table>

</td>

<td colspan="4" width="245" valign="top" style="padding-top: 3px;padding-right: 10px">

<table width="170" class="rcptlstHead" valign="top">

<tr>

<td width=""><p style="FONT-SIZE:8pt;font-family:Arial;TEXT-ALIGN: right""><b>For General Tax Questions</b></p>

</tr>

<tr>

<td><p style="FONT-SIZE:8pt;font-family:Arial;TEXT-ALIGN: right"> Call Our Toll Free Number</p></td>

</tr>

<tr>

<td><p style="FONT-SIZE:10pt;font-family:Arial;TEXT-ALIGN: right"><b>0800117000</b></p></td>

</tr>

<tr>

<td><p style="FONT-SIZE:8pt;font-family:Arial;TEXT-ALIGN: right"> Or log onto URA web portal</p>

</td>

</tr>

<tr>

<td><p style="FONT-SIZE:10pt;font-family:Arial;TEXT-ALIGN: right"> <b>http://ura.go.ug </b></p>

</td>

</tr>

</table>

</td>

</tr>

<tr> <td> &nbsp; </td> </tr>

<tr class="rcptFont">

<td colspan="4">

&nbsp;&nbsp;Dr. dfdfd asfdsf

</td>

<td colspan="5" >

&nbsp;Notice Date : <strong>09/09/2011</strong>

</td>

</tr>





<tr class="rcptFont">

<td colspan="4">

&nbsp;&nbsp; ,

</td>

<td colspan="5" >

&nbsp;Reference No :<strong>LI02120001570</strong>

</td>

</tr>

<tr class="rcptFont">

<td colspan="4">

&nbsp;&nbsp; addaf ,

</td>

<td colspan="5" align="right">

<img src="http://localhost:8080/URAPortalBC/barcode?data=LI02120001570&amp;headless=false&amp;drawText=false&amp;width=1&amp;height=5&amp;type-Code128B" border="0" alt=""/>

</td>

</tr>

<tr class="rcptFont">

<td colspan="4">

&nbsp;&nbsp;AMOLATAR, KIOGA, AMOLATAR TOWN COUNCIL

</td>

<td colspan="5" >

&nbsp;TIN : <strong>N.A.</strong>

</td>

</tr>



<tr> <td> &nbsp; </td> </tr>



<td colspan=10>

<table align="center" border="1" bordercolor="black" valign="top" width="90%" cellpadding="0" cellspacing="0" class="marginStyle">

<tr class="rcptFont">

<td colspan="8">

<center><b>Declaration of Instrument For Stamp Duty</b></center>

</td>

<tr class="rcptFont">

<td align="center" width="5%" class="mainpagebordr" align="left"><b>1</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>TIN of applicant</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>N.A.</b></td>

</tr>





<tr class="rcptFont">

<td align="center" width="5%" class="mainpagebordr" align="left"><b>2</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>Name of Taxpayer</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>Dr. dfdfd asfdsf</b></td>

</tr>



<tr class="rcptFont">

<td align="center" width="5%"class="mainpagebordr" align="left"><b>3</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>Type of Instrument</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>CANCELLATION-instrument of</b></td>

</tr>

<tr class="rcptFont">

<td align="center" width="5%" class="mainpagebordr" align="left"><b>4</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>Number of copies to be stamped</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>2</b></td>

</tr>



<tr class="rcptFont">

<td align="center" width="5%" class="mainpagebordr" align="left"><b>5</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>Amount of Duty (UGX)</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>0</b></td>

</tr>





<tr class="rcptFont">

<td align="center" width="5%" class="mainpagebordr" align="left"><b>6</b></td>

<td align="left" width="45%" class="mainpagebordr" align="left"><b>Payment registration Number</b></td>

<td align="left" width="50%" class="mainpagebordr" align="left"><b>2120000000412</b></td>

</tr>



</table>

</td>

<br>

<br>

<tr align="center" class="rcptFont">

<td colspan="10"><b></b>

<br>

<table align="left">

<tr><td class="rcptFont1">Your Search code:&nbsp;</td>

<td class="rcptFont1"><strong>52065557675TW</strong></td>

</tr>

</table>

</td>

</tr>



<tr> <td> &nbsp; </td> </tr>

<tr> <td> &nbsp; </td> </tr>

<tr class="rcptFont">

<td colspan="8">

<center><b>Official URA Representative</b></center>

</td>

</tr>

<tr class="rcptFont">

<td colspan="8">

<center>Please check for the status of your application at the nearest tax office or</center>

</td>

</tr>

<tr class="rcptFont">

<td colspan="8">

<center>the URA web portal at http://ura.go.ug</center>

</td>

</tr>

<tr>

<td colspan="10">

<hr style="height:1px;">

<p style="FONT-SIZE:8pt;font-family:Arial;TEXT-ALIGN: center;">Plot 26/28, Olwol Road, Opposite Blue Valley Guest House, LIRA</p>

</td>

</tr>

</table>

</td>

</tr>



</table>

<table align="center" >

<!--<tr >

<td align="center">

<form name="receiptForm" method="post">

<input type="hidden" name="dispatch" value="" />

<div id="buttons">

<input type="button" value="Print" id='printBtn' class="submit" onmouseover="hideStatusMsg()" onclick="printReceipt()" />

<input type="button" class="submit" value="Back" id='backBtn' onclick="backToRegn()" onmouseover="hideStatusMsg()"/>

</div>

</form>

</td>

</tr>

--></table>



<!-- payment receipt

-->
</center>

</body>
</html>

最佳答案

改变这个:

<center>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="marginStyle" align="center">

对此:

<table width="100%" cellpadding="0" cellspacing="0">

还有这个:

.marginStyle{margin: 0 auto;} 

对此:

table { text-align: center; margin: 0 auto; border-collapse: collapse; border: 1px solid red; }
table tr, table td { text-align: left; }

关于html - 如何在所有浏览器中添加表格边框并使表格居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7363115/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com