html设置粗体字,如何在HTML输出中设置粗体字段

以下是我的PowerShell脚本。它会生成一个格式良好的HTML表格。我想将一列加粗(Full%列)。我不能为了我的生活想到一个办法。如何在HTML输出中设置粗体字段

我试过在不同的地方插入粗体标签,并尝试过使用替换方式的想法,但由于列中的数字发生了变化,所以我想不出做到这一点的方法。

$symmid = 1555

$command1 = symfast -sid $symmid list -association -demand

$command2 = symcfg -sid $symmid list -thin -pool -detail -gb

$basedir = "C:\ts\Scripts"

$timestamp = Get-Date -Format ddMMyyyy

$CSSFile = "$basedir\csstemplate.css"

$css = get-content $CSSFile

$command1 > $basedir\archive_vp\archive_$timestamp.txt

$command2 > $basedir\archive_pool\archive_$timestamp.txt

$regex = '(?ms)P O O L S(.+?)\r\n\s*\r\n'

$command2 = $command2 -join "`r`n"

$command2 = [regex]::Matches($command2,$regex) | foreach {$_.groups[1].value}

$command2 = $command2 -split "`r`n" | select -Skip 5

$command2Format = $command2 | % {

$column = $_ -split ' +'

$hash = [ordered]@{

'Pool Name' = $column[0]

'Flags PTECSL' = $column[1]

'Dev Config' = $column[2]

'Total GBs' = $column[3]

'Usable GBs' = $column[4]

'Free GBs' = $column[5]

'Used GBs' = $column[6]

'Full (%)' = $column[7]

'Subs (%)' = $column[8]

'Comp (%)' = $column[9]

'Shared GBs' = $column[10]

}

New-Object -Type PSCustomObject -Property $hash

} | ConvertTo-Html -Head $a

function get-css

{

foreach($line in $css)

{

$style += $line

}

return $style

}

$style = "

$style = get-css

$style += ""

$report = "

$style$command2Format"

$report | Out-File $basedir\test.html

Invoke-Expression $basedir\test.html

输出:

2XeX1.png

2015-04-01

RichT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值