-2

I've just finished an ASCII table design like:

+------+------+
|id    |name  |
+------+------+
|1     |x     |
+------+------+

now I'm trying to color those text. I found some way with PHP image/HTML way. Is there any way to color those text without PHP image create/HTML.

Objective: Color each column's text with same color. eg. all values of id col with color 'red', name col with green and so on.

NOTE: It's not a console output nor a HTML page. Just draw with PHP, inspired from here

Please help me.

The System Restart
  • 2,873
  • 19
  • 28

1 Answers1

0

This really depends where you are going to output the table.

If you are using a command shell (dos-window, bash etc.) then you can use some special escape codes or api functions to color your output. If you are using a browser which gets mime type text/text you can't color anything. If you are using a browser which gets mime type text/html you can use CSS with fixed char sizes (font courier)

In fact you need to tell us, where do you wan't to output your table.

Community
  • 1
  • 1
coding Bott
  • 4,287
  • 1
  • 27
  • 44