# \hfill

Used inside an array-like cell to mark a horizontal fill position that MathJax later converts into cell alignment metadata; at the start or end of a cell it can force right/left alignment, and markers at both ends center the entry.

https://texform.dev/latex/commands/hfill

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Spacing](https://texform.dev/latex/topics/spacing) |
| Packages | base |
| Allowed mode | math |
| Tags | invisible |
| Commonality | medium |
| Kind | prefix |

## Syntax

### base

Argument specification: ``

Used inside an array-like cell to mark a horizontal fill position that MathJax later converts into cell alignment metadata; at the start or end of a cell it can force right/left alignment, and markers at both ends center the entry.

## Examples

```latex
\begin{array}{c}a\hfill\end{array}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Barray%7D%7Bc%7Da%5Chfill%5Cend%7Barray%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | none | full |

## Usage frequency

0.03% of formulas in the measured corpus contain this entry, rank 140 of 263 entries with frequency data.

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

## Equivalent forms

```latex
\hfil
```

exact. Exact in current MathJax implementation because BaseMappings routes both names to BaseMethods.HFill, though traditional TeX distinguishes their glue orders.

```latex
\hfilll
```

exact. MathJax-only alias currently mapped to the same HFill handler.

## See also

- [\\hfil](https://texform.dev/latex/commands/hfil)
- [\\hfilll](https://texform.dev/latex/commands/hfilll)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \begin{array}{cc} a \hfill & b \end{array} | Positive: ctx:in-array | Pass | Fail | Pass |
