The char attribute of the <td> tag is used to align the content of a table cell based on a specific character. It was mainly used in older HTML versions and is now deprecated in HTML5.
- Aligns cell content relative to a specified character (e.g., ., ,, :)
- Used along with the align="char" attribute.
- Commonly used for aligning numeric or tabular data.
Note: The char attribute is deprecated in HTML5; use CSS for alignment instead
Syntax:
<td char="character">Attribute Values:
- character: It is used to specify the character to align the content.
<!DOCTYPE html>
<html>
<head>
<title>HTML td char Attribute</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML td char Attribute</h2>
<table width="500" border="1">
<tr>
<th>Name</th>
<th>Expenses</th>
</tr>
<tr>
<td>BITTU</td>
<td align="char" char=".">
2500.00
</td>
</tr>
<tr>
<td>RAKESH</td>
<td align="char" char=".">
1400.00
</td>
</tr>
</table>
</body>
</html>