Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

HTML5 Tags ใดเหมาะสำหรับแสดงจำนวนเงิน (Money Amount)

แท็กที่เหมาะสมสำหรับราคา/เงิน

  • Microdata (Schema.org) - itemprop="price" ใน Product หรือ Offer
  • <strong> - เน้นความสำคัญของราคา (Semantic importance)
  • <span class="price"> - จัดสไตล์ด้วย CSS (Flexible)
  • <b> - เน้นแบบ Visual (Non-semantic)

ตัวอย่าง Microdata

<div itemscope itemtype="https://schema.org/Product">
  <span itemprop="name">Product Name</span>
  <span itemprop="price" content="1299.00">฿1,299</span>
</div>

ตารางข้อมูลเงินเดือน/ราคาหุ้น

<th scope="col">Salary</th>

ใช้ scope="col" บอกว่าเป็น Header ของคอลัมน์