Question: I'm trying to figure out how to right align the span text

**html**

```
<div class="table-css">
  <table>
    <tr><td>Text aligned left in row. <span>Text aligned right in row.</span></td></tr>
  </table>
</div>

```

**css**

```
.table-css table { width: 600px; }
.table-css td a { display: block; }
.table-css td a:hover { background-color: #333; }
.table-css td span { display: inline; text-align: right; }

```

Result should be like this:

```
Text aligned left in row.                         Text aligned right in row.

```

Answer: 
Your only option is to iterate over the object you are encoding and to encode it item by item, probably writing your own json notation to contain the generated json.

For example

```
echo "["; // or { for an associative array (don't forget to output the json_encode()d keys and their colons)
$first = true;
for ($i = 0; $i < 10000000; $i++) {
    // json does not support trailing commas like php does
    // and you can't do an implode(",", $array) here because of the memory usage
    if ($first) {
        $first = false;
    } else {
        echo ",";
    }
    echo json_encode($i);
}
echo "]"; // or }

```

taken from here:
<http://forums.phpfreaks.com/topic/288266-json-encode-exceeds-allowed-memory/>
You can use smarty template to put json just reading file from disk. 
Or you can check this <https://stackoverflow.com/a/4820537/3900160>