gpt4 book ai didi

c# - 如何在 asp.net 中给出表格的 cellpadding、cellspacing

转载 作者:行者123 更新时间:2023-11-27 23:54:32 25 4
gpt4 key购买 nike

我想设置表格的 widthheightcllpaddingcellspacing 以及 valign,但我做到了在 asp.Net 中找不到这些属性。 (但这些标签在 PHP Dreamweaver 中可用)指导我如何为 asp.Net 中的表设置这四个。我有 visual studio 2012。

<table width="1332" height="231" border="1" >
<tr>
<td colspan="2" rowspan="2">Region</td>
<td height="21" colspan="3"><span id="result_box" lang="ar" xml:lang="ar">المجموع العام</span></td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2">مسندم</td>
<td colspan="2" rowspan="2"><span id="result_box2" lang="ar" xml:lang="ar">منطقة</span></td>
</tr>
<tr>
<td height="23" colspan="3">Grand Total</td>
<td colspan="2">&nbsp;</td>
<td colspan="2">Musandam</td>
<td colspan="2">Al-wusta</td>
<td colspan="2">Alburaimi</td>
<td colspan="2">Al-Dhahira</td>
<td colspan="2">Dohfar</td>
<td colspan="2">Al-dhakhila</td>
<td colspan="2">Al-sharqiya(n)</td>
<td colspan="2">Al-sharqiyah</td>
<td colspan="2">Albatiniah(s)</td>
<td colspan="2">Al-Albatinah</td>
<td colspan="2">Muscat</td>
</tr>
<tr>
<td colspan="2">Gender</td>
<td width="77"><span id="result_box8" lang="ar" xml:lang="ar">مجموع</span></td>
<td width="24">١</td>
<td width="24">ذ</td>
<td width="10">١</td>
<td width="14">ذ</td>
<td width="45">١</td>
<td width="16">ذ</td>
<td width="11">١</td>
<td width="34">ذ</td>
<td width="13">١</td>
<td width="39">ذ</td>
<td width="25">١</td>
<td width="32">ذ</td>
<td width="16">١</td>
<td width="20">ذ</td>
<td width="28">١</td>
<td width="32">ذ</td>
<td width="28">١</td>
<td width="49">ذ</td>
<td width="42">١</td>
<td width="25">ذ</td>
<td width="26">١</td>
<td width="44">ذ</td>
<td width="38">١</td>
<td width="29">ذ</td>
<td width="22">١</td>
<td width="17">ذ</td>
<td colspan="2"><span id="result_box3" lang="ar" xml:lang="ar">جنس</span></td>
</tr>
<tr>
<td colspan="2">Specialization</td>
<td>Total</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td colspan="2"><span id="result_box4" lang="ar" xml:lang="ar">تخصص</span></td>
</tr>
<tr>
<td width="68" rowspan="4" valign="top">Foundation</td>
<td width="152" valign="top">Engnieering</td>
<td height="23">120</td>
<td>48</td>
<td>72</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td width="105" valign="top">الهندسة</td>
<td width="37" rowspan="4" valign="top">مؤسسة</td>
</tr>
<tr>
<td valign="top">Information Technology</td>
<td>213</td>
<td>147</td>
<td>66</td>
<td>1</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td valign="top">تكنولوجيا المعلومات</td>
</tr>
<tr>
<td rowspan="2" valign="top">Total</td>
<td rowspan="2">313</td>
<td height="28">195</td>
<td>138</td>
<td>1</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td rowspan="2" valign="top">إجمالي</td>
</tr>
<tr>
<td height="26" colspan="2">313</td>
<td colspan="2">3</td>
<td colspan="2">0</td>
<td colspan="2">4</td>
<td colspan="2">0</td>
<td colspan="2">4</td>
<td colspan="2">0</td>
<td colspan="2">4</td>
<td colspan="2">0</td>
<td colspan="2">4</td>
<td colspan="2">0</td>
<td colspan="2">4</td>
<td colspan="2">0</td>
</tr>
</table>

height width valign top 在visual studio中也是不可用的

最佳答案

如果您确实喜欢只使用 HTML 编写代码,可以这样做:

<table cellspacing="10px" cellpadding="10px" style = "height = 200px;width:200px;"> 

注意:cellspacing 和 cellpadding 已过时,我认为在 HTML5 中,但如果您尝试一下,它仍然有效(但也许您的编辑器会像在 Eclipse IDE 上那样给您警告消息)。在重新设计页面时,在 HTML 标记中添加 css style 是肮脏的并且难以维护。

使用 CSS:

    table { border-spacing: 5px;/*use to work like cellspacing */
width : 200px;
height:200px;
}

th, td { padding: 5px; } /*use to work like cellpadding */

关于c# - 如何在 asp.net 中给出表格的 cellpadding、cellspacing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24845606/

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