gpt4 book ai didi

javascript - 使用内联 CSS 在 HTML 表格中应用美元货币格式

转载 作者:搜寻专家 更新时间:2023-10-31 22:41:47 25 4
gpt4 key购买 nike

<分区>

我正在创建一个定期发布的销售数据网络广播,并且正在努力以美元货币格式正确设置销售总额的格式($ 符号,千位逗号分隔符,2 位小数)。使用以下文件控制网络广播。我是 HTML 和 CSS 的新手,非常感谢任何具体指导。我一直在研究和测试,但只需要任何帮助或想法 - 谢谢!

到目前为止尝试过:为此创建一个 SPAN,例如: .dollars:before {content:'$';}

还有: {来源} {销售金额}

我也试过这个,但无法正常工作。 http://www.webdeveloper.com/forum/showthread.php?43459-CSS-number-formatting

<style type='text/css'>
caption.mytable
{
background-color:99CCFF;
color:black;
border-style:solid;
border-width:1px;
border-color:336699;
text-align:center;
}

table.mytable
{
font-family:Tahoma;
border-collapse:collapse;
font-size:10pt;
background-color:white;
width:100%;
border-style:solid;
border-color:336699;
border-width:1px;
}

th.mytable
{
font-size:8pt;
color:black;
text-align:center;
font-weight:bold;
}

tr.mytable
{
}

td.mytable
{
font-size:8pt;
background-color:white;
color:black;
border-style:solid;
border-width:1px;
border-color:cccccc;
text-align:left;
padding:3px;
}
</style>

<table class='mytable'>
<caption class="mytable">{EVENT_DESCRIPTION_COLOR} as of {EVENT_DATE}</caption>
<thead>
<tr class='mytable'>
<th class='mytable'>Source Type</th>
<th class='mytable'>Sales Amount</th>
</tr>
</thead>
<tbody>

<tr class='mytable'>
<td class='mytable'>{Source}</td>
<td class='mytable'>{SalesAmount}</td>
</tr>

</tbody>
</table>
<style type='text/css'>
caption.mytable
{
background-color:99CCFF;
color:black;
border-style:solid;
border-width:1px;
border-color:336699;
text-align:center;
}

table.mytable
{
font-family:Tahoma;
border-collapse:collapse;
font-size:10pt;
background-color:white;
width:100%;
border-style:solid;
border-color:336699;
border-width:1px;
}

th.mytable
{
font-size:8pt;
color:black;
text-align:center;
font-weight:bold;
}

tr.mytable
{
}

td.mytable
{
font-size:8pt;
background-color:white;
color:black;
border-style:solid;
border-width:1px;
border-color:cccccc;
text-align:left;
padding:3px;
}
</style>

<table class='mytable'>
<caption class="mytable">{EVENT_DESCRIPTION_COLOR} as of {EVENT_DATE}</caption>
<thead>
<tr class='mytable'>
<th class='mytable'>Source Type</th>
<th class='mytable'>Sales Amount</th>
</tr>
</thead>
<tbody>

<tr class='mytable'>
<td class='mytable'>{Source}</td>
<td class='mytable'>{SalesAmount}</td>
</tr>

</tbody>
</table>

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