I have data that is being outputted with printf: printf("<tr><td>%s</td> <td>%s</td> <td>\$%s</td> </tr>", $sku, $name, $price); PHP: As you can see, there are 3 variables that are being put into 3 columns, each query gets its own table row. The problem I'm having is being able to do <td align="center">. It brings up an error saying: Parse error: syntax error, unexpected T_STRING I was wondering how I'm allowed to use the = and " symbols to get my columns aligned!
Well there are several solutions, I think the best is not to use printf, use echo. echo "<tr><td align=\"center\">$sku</td> <td>$name</td> <td>$price</td> </tr>"; if printf: printf("<tr><td align='center'>%s</td> <td>%s</td> <td>\$%s</td> </tr>", $sku, $name, $price); Or: printf("<tr><td align=\"center\">%s</td> <td>%s</td> <td>\$%s</td> </tr>", $sku, $name, $price);