在for循环中将forst列字母加粗

时间:2017-08-23 19:43:04

标签: html shell

我正在尝试使用html以表格格式打印挂载点空间。我需要粗体的第一列。请帮帮我。

这是我到目前为止所做的:

input="/tmp/mountpoint.txt"
tmpfile="/tmp/tmpfile.html"
output="/tmp/df.out"
df -PTh | column -t | sort -n -k6n > $input
awk 'BEGIN{print "<html><body><table border=1>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td><font color='#00000'>" $i"</td></font>";print "</tr>"} END{print "</table></body></html>"}' "$input" > "$tmpfile"
sed -e '10d' $tmpfile > $output`

O/P of my script

1 个答案:

答案 0 :(得分:0)

您可以尝试这样:

Fiddle

&#13;
&#13;
td:first-child{
  font-weight: bold !important;
  color:blue;
}
&#13;
<div class='textWord_about'>
  <table border='1'>
    <tbody>
    <tr>
      <td>1111111111111111111111111111</td>
      <td>2222</td>
      <td>3333</td>
      <td>4444</td>
    </tr>
    <tr>
      <td>11111111111111111111111111</td>
      <td>2222</td>
      <td>3333</td>
      <td>4444</td>
    </tr>
    <tr>
      <td>11111111111111111111111111111111</td>
      <td>2222</td>
      <td>3333</td>
      <td>4444</td>
    </tr>
    <tr>
      <td>1111111111111111111111111111111</td>
      <td>2222</td>
      <td>3333</td>
      <td>4444</td>
    </tr>
    <tr>
      <td>11111111111111111111111111111111111</td>
      <td>2222</td>
      <td>3333</td>
      <td>4444</td>
    </tr>
    </tbody>
  </table>
</div>
<div class='directly-follow'>

</div>
&#13;
&#13;
&#13;