I am trying to format the text in NSTextViewto fit on the same line with a black background. One part of the text should be aligned to the left, the other part (but still on the same line) should be centered.
NSString *header = [NSString stringWithFormat:
@""
"<table style=\"width: 100%; background: black; "
"color: white; font-family: Arial; "
"font-size: 16px;\"><tr><td>"
"1. zadatak"
"</td><td align=\"center\" width=\"100%\">"
""
"%@"
""
"</td></tr></table>"
"", [self.problemname.stringValue uppercaseString]];
Unfortunately, no matter what width I specify NSTextView, it seems to ignore the width of the table.
Any workarounds, different approaches or other suggestions?
Additional information on the background of the problem.
I wrote an application for writing tasks for programming contests. Each task author presents content in a different format, so getting standardization in a simple package will be of great benefit.
I need this for the print module. I take a few NSTextViewand sew them together.
, : PDF (GoogleDocs)
Contest header
+------------------------------------------------+
| 1st Task TITLE 20 points |
+------------------------------------------------+
Introductory text here.
Input
Explanation of input data
Output
Explanation of output data
Sample Data
Input: | Input:
abcd | bcde
|
Output: | Output:
efgh | fghi
|
More info: |
info text |