Hi,
I'm trying to format some text in NSTextView
to be placed in a single line with black background. One piece of text needs to be left aligned, the other piece (but still in the same line) needs to 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
appears to ignore the table width.
Any workarounds, different approaches, or other suggestions?
More info on the background of the problem.
I've written an app for writing tasks for programming contests. Each task author submits content in different format, so getting them to standardize it in a simple bundle would be of great benefit.
I need this for a printing module. I'm taking several NSTextView
s and stitching them together.
These contests have the following document formatting which we're supposed to follow - Example 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 |